From c6b65d8988e0f4bdb8c0e33a19dcea8bfd2e480f Mon Sep 17 00:00:00 2001 From: anatolykopyl Date: Sat, 11 Nov 2023 01:33:37 +0300 Subject: [PATCH] Show stringified data --- index.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/index.ts b/index.ts index e32eba5..bfcee45 100644 --- a/index.ts +++ b/index.ts @@ -9,15 +9,14 @@ const server = Bun.serve({ throw new Error("woops!"); } - const submittedData: { email: unknown, where: unknown } = await req.json(); + const submittedData = await req.json(); const text = encodeURIComponent(` *Новое письмо с flexpatrol.ru* \`\`\` -email: ${submittedData.email} -на че наклеешь: ${submittedData.where} -\`\`\` - `) +${JSON.stringify(submittedData)} +\`\`\``) + await fetch(`https://api.telegram.org/bot${BOT_TOKEN}/sendMessage?chat_id=${CHAT_ID}&text=${text}&parse_mode=markdown`) return new Response('success', {