From 6522600c426b3d69880e1fdfb99912bd84eefbf3 Mon Sep 17 00:00:00 2001 From: zomars Date: Fri, 21 Oct 2022 12:55:35 -0600 Subject: [PATCH] Add missing bodyUserId --- pages/api/webhooks/[id]/_patch.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/api/webhooks/[id]/_patch.ts b/pages/api/webhooks/[id]/_patch.ts index dbcc8c8306..cb645e4363 100644 --- a/pages/api/webhooks/[id]/_patch.ts +++ b/pages/api/webhooks/[id]/_patch.ts @@ -50,9 +50,9 @@ export async function patchHandler(req: NextApiRequest) { if (!isAdmin && bodyUserId) throw new HttpError({ statusCode: 403, message: `ADMIN required for userId` }); if (isAdmin && bodyUserId) { - const where: Prisma.UserWhereInput = { id: userId }; + const where: Prisma.UserWhereInput = { id: bodyUserId }; await prisma.user.findFirstOrThrow({ where }); - args.data.userId = userId; + args.data.userId = bodyUserId; } const result = await prisma.webhook.update(args);