Fixing some lint errors with the new admin features

This commit is contained in:
Keith Stevens
2023-01-08 20:21:13 +09:00
parent 39485c6ced
commit e69715fbec
6 changed files with 6 additions and 8 deletions
+1 -1
View File
@@ -5,7 +5,7 @@ import { getToken } from "next-auth/jwt";
* Wraps any API Route handler and verifies that the user has the appropriate
* role before running the handler. Returns a 403 otherwise.
*/
const withRole = (role: string, handler: (arg0: NextApiRequest, arg1: NextApiResponse<any>) => any) => {
const withRole = (role: string, handler: (arg0: NextApiRequest, arg1: NextApiResponse) => void) => {
return async (req: NextApiRequest, res: NextApiResponse) => {
const token = await getToken({ req });
if (!token || token.role !== role) {