From 07b011424f8a8f83f8846cde08c6b30419096c3d Mon Sep 17 00:00:00 2001 From: zomars Date: Sat, 15 Oct 2022 10:54:22 -0600 Subject: [PATCH] Formatting --- pages/api/users/[userId]/_delete.ts | 3 +-- pages/api/users/[userId]/_get.ts | 3 +-- pages/api/users/[userId]/_patch.ts | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/pages/api/users/[userId]/_delete.ts b/pages/api/users/[userId]/_delete.ts index 9d512985eb..46ab08e5f9 100644 --- a/pages/api/users/[userId]/_delete.ts +++ b/pages/api/users/[userId]/_delete.ts @@ -33,8 +33,7 @@ export async function deleteHandler(req: NextApiRequest) { const { prisma, isAdmin } = req; const query = schemaQueryUserId.parse(req.query); // Here we only check for ownership of the user if the user is not admin, otherwise we let ADMIN's edit any user - if (!isAdmin && query.userId !== req.userId) - throw new HttpError({ statusCode: 403, message: "Forbidden" }); + if (!isAdmin && query.userId !== req.userId) throw new HttpError({ statusCode: 403, message: "Forbidden" }); const user = await prisma.user.findUnique({ where: { id: query.userId } }); if (!user) throw new HttpError({ statusCode: 404, message: "User not found" }); diff --git a/pages/api/users/[userId]/_get.ts b/pages/api/users/[userId]/_get.ts index ba9c8f61b5..360103560b 100644 --- a/pages/api/users/[userId]/_get.ts +++ b/pages/api/users/[userId]/_get.ts @@ -35,8 +35,7 @@ export async function getHandler(req: NextApiRequest) { const query = schemaQueryUserId.parse(req.query); // Here we only check for ownership of the user if the user is not admin, otherwise we let ADMIN's edit any user - if (!isAdmin && query.userId !== req.userId) - throw new HttpError({ statusCode: 403, message: "Forbidden" }); + if (!isAdmin && query.userId !== req.userId) throw new HttpError({ statusCode: 403, message: "Forbidden" }); const data = await prisma.user.findUnique({ where: { id: query.userId } }); const user = schemaUserReadPublic.parse(data); return { user }; diff --git a/pages/api/users/[userId]/_patch.ts b/pages/api/users/[userId]/_patch.ts index aca10a89bb..9af08bb210 100644 --- a/pages/api/users/[userId]/_patch.ts +++ b/pages/api/users/[userId]/_patch.ts @@ -55,8 +55,7 @@ export async function patchHandler(req: NextApiRequest) { const { prisma, isAdmin } = req; const query = schemaQueryUserId.parse(req.query); // Here we only check for ownership of the user if the user is not admin, otherwise we let ADMIN's edit any user - if (!isAdmin && query.userId !== req.userId) - throw new HttpError({ statusCode: 403, message: "Forbidden" }); + if (!isAdmin && query.userId !== req.userId) throw new HttpError({ statusCode: 403, message: "Forbidden" }); const body = schemaUserEditBodyParams.parse(req.body); const userSchedules = await prisma.schedule.findMany({