Add missing bodyUserId

pull/9078/head
zomars 2022-10-21 12:55:35 -06:00
parent 7617cd43e1
commit 6522600c42
1 changed files with 2 additions and 2 deletions

View File

@ -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);