fix build and pass lint

This commit is contained in:
Agusti Fernandez Pardo committed 2022-05-17 19:33:18 +02:00
1 parent 3366627835
commit 5aa0b37443
30 files changed
+193 -74

No files matched your search

+4 -1
View File
@@ -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 })
+4 -1
View File
@@ -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);