fix build and pass lint
This commit is contained in:
1 parent
3366627835
commit
5aa0b37443
30 files changed
+193
-74
No files matched your search
@@ -85,7 +85,10 @@ export async function WebhookById(
|
||||
case "PATCH":
|
||||
const safeBody = schemaWebhookEditBodyParams.safeParse(body);
|
||||
if (!safeBody.success) {
|
||||
throw new Error("Invalid request body");
|
||||
{
|
||||
res.status(400).json({ message: "Invalid request body" });
|
||||
return;
|
||||
}
|
||||
}
|
||||
await prisma.webhook
|
||||
.update({ where: { id: safeQuery.data.id }, data: safeBody.data })
|
||||
|
||||
@@ -56,7 +56,10 @@ async function createOrlistAllWebhooks(
|
||||
* description: Authorization information is missing or invalid.
|
||||
*/
|
||||
const safe = schemaWebhookCreateBodyParams.safeParse(body);
|
||||
if (!safe.success) throw new Error("Invalid request body");
|
||||
if (!safe.success) {
|
||||
res.status(400).json({ message: "Invalid request body" });
|
||||
return;
|
||||
}
|
||||
|
||||
const data = await prisma.webhook.create({ data: { ...safe.data, userId } });
|
||||
const webhook = schemaWebhookReadPublic.parse(data);
|
||||
|
||||
Reference in new issue
Block a user