401 return fix
parent
4e97133751
commit
9b1dffbdb9
|
@ -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 } });
|
||||||
|
|
Loading…
Reference in New Issue