Skip to content

Commit

Permalink
fix: eslint warning (import/no-anonymous-default-export)
Browse files Browse the repository at this point in the history
  • Loading branch information
fernandoxu committed Jul 4, 2022
1 parent 46090e3 commit a1cce55
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion template/addons/next-auth/restricted.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { NextApiRequest, NextApiResponse } from "next";
import { unstable_getServerSession as getServerSession } from "next-auth";
import { authOptions as nextAuthOptions } from "./auth/[...nextauth]";

export default async (req: NextApiRequest, res: NextApiResponse) => {
const restricted = async (req: NextApiRequest, res: NextApiResponse) => {
const session = await getServerSession(req, res, nextAuthOptions);

if (session) {
Expand All @@ -18,3 +18,5 @@ export default async (req: NextApiRequest, res: NextApiResponse) => {
});
}
};

export default restricted;
4 changes: 3 additions & 1 deletion template/addons/prisma/sample-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
import type { NextApiRequest, NextApiResponse } from "next";
import { prisma } from "../../server/db/client";

export default async (req: NextApiRequest, res: NextApiResponse) => {
const examples = async (req: NextApiRequest, res: NextApiResponse) => {
const examples = await prisma.example.findMany();
res.status(200).json(examples);
};

export default examples;

0 comments on commit a1cce55

Please sign in to comment.