Skip to content

Commit 3d3886d

Browse files
committed
fix: crash on adding webhook to database
1 parent 0f917c1 commit 3d3886d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/routes/hooks.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ export enum WebhookHandledStatus {
1717
Error = "error",
1818
};
1919

20-
export const addWebhookToDB = async function(prisma: PrismaClient, webhookHeaders: WebhookHeaders, body: string): Promise<void> {
20+
export const addWebhookToDB = async function(prisma: PrismaClient, webhookHeaders: WebhookHeaders, body: any): Promise<void> {
2121
await prisma.intraWebhook.create({
2222
data: {
2323
model: webhookHeaders.modelType,
2424
event: webhookHeaders.eventType,
2525
delivery_id: webhookHeaders.deliveryId,
26-
body: body,
26+
body: JSON.stringify(body),
2727
received_at: new Date(),
2828
status: WebhookHandledStatus.Unhandled,
2929
},

0 commit comments

Comments
 (0)