Merge pull request #111 from calcom/hotfix/webhook-error-throw

Hotfix/webhook error throw
pull/9078/head
Syed Ali Shahbaz 2022-06-08 13:28:59 +05:30 committed by GitHub
commit 19446c265f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 6 deletions

View File

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

View File

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