From 1c8f09e4ddcf4f213851214a2c2f9ae92a62788a Mon Sep 17 00:00:00 2001 From: TZGyn Date: Tue, 11 Feb 2025 21:17:34 +0800 Subject: [PATCH] update webhook --- src/routes/webhook/tradingview/+server.ts | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/routes/webhook/tradingview/+server.ts b/src/routes/webhook/tradingview/+server.ts index df1129e..4d0b1cf 100644 --- a/src/routes/webhook/tradingview/+server.ts +++ b/src/routes/webhook/tradingview/+server.ts @@ -4,16 +4,9 @@ import { z } from 'zod' export const POST = async ({ locals, request }) => { const type = request.headers.get('Content-Type') + if (type !== 'application/json') return new Response() - console.log('type', type) - - const text = await request.text() - - console.log('text', text) - - const body = JSON.parse(text) - - console.log('text', body) + const body = await request.json() const flatSchema = z.object({ type: z.literal('Flat'),