From e629808825c2b7925bf4a09bfe1bb4b6bf532a47 Mon Sep 17 00:00:00 2001 From: TZGyn Date: Tue, 11 Feb 2025 18:57:11 +0800 Subject: [PATCH] enable webhook --- src/routes/webhook/tradingview/+server.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/routes/webhook/tradingview/+server.ts b/src/routes/webhook/tradingview/+server.ts index 5b37190..5ef2dee 100644 --- a/src/routes/webhook/tradingview/+server.ts +++ b/src/routes/webhook/tradingview/+server.ts @@ -6,9 +6,6 @@ import { z } from 'zod' export const POST = async ({ locals, request }) => { const body = await request.json() - console.log(body) - return json({}) - const form = z .object({ key: z.string(), @@ -21,7 +18,10 @@ export const POST = async ({ locals, request }) => { }) .safeParse(body) - if (!form.success) return json({}, { status: 400 }) + if (!form.success) { + console.log(form.error) + return json({}, { status: 400 }) + } // const apiKey = 'wrc1w54Zp5JAfXLxY2' // const apiSecret = 'tY7oYPhwSE1gabFS4PmxtmbDOhkYWvPh0khf'