401 return fix

pull/9078/head
Syed Ali Shahbaz 2022-06-08 13:27:48 +05:30 committed by GitHub
parent 4e97133751
commit 9b1dffbdb9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 3 deletions

View File

@ -77,9 +77,8 @@ async function createOrlistAllWebhooks(
// Team should be available and the user should be a member of the team // Team should be available and the user should be a member of the team
if (!team?.members.some((membership) => membership.userId === userId)) { if (!team?.members.some((membership) => membership.userId === userId)) {
throw new TRPCError({ res.status(401).json({ message: "Unauthorized" });
code: "UNAUTHORIZED", return;
});
} }
} }
const data = await prisma.webhook.create({ data: { id: uuidv4(), ...safe.data, userId } }); const data = await prisma.webhook.create({ data: { id: uuidv4(), ...safe.data, userId } });