From 8fa35f30df8ff08c7cf0bd4c2851bafe6245c5c8 Mon Sep 17 00:00:00 2001 From: Happy Kid Date: Sun, 24 Sep 2023 14:01:09 +0530 Subject: [PATCH] added notifications --- app/contact/page.tsx | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/app/contact/page.tsx b/app/contact/page.tsx index 710e1fd..c36e884 100644 --- a/app/contact/page.tsx +++ b/app/contact/page.tsx @@ -19,6 +19,15 @@ export default function SendEmail() { }, body: JSON.stringify({ name, message }), }); + + response = await fetch('http://129.159.21.84:3001/api/send_message', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify({ name, message }), + }); + alert("Message sent!") } catch (error) { alert('Error in sending message.\n Sorry :('); @@ -63,4 +72,4 @@ export default function SendEmail() { ) -} \ No newline at end of file +}