From 5918ce050c4d7a28c43fa54f4feff03cc09a36ac Mon Sep 17 00:00:00 2001 From: Manuel Bustillo Date: Sun, 27 Oct 2024 11:33:40 +0100 Subject: [PATCH] WIP make requests to the backend --- app/ui/guests/table.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/ui/guests/table.tsx b/app/ui/guests/table.tsx index 0b9a9ae..9090c18 100644 --- a/app/ui/guests/table.tsx +++ b/app/ui/guests/table.tsx @@ -11,6 +11,13 @@ export function TableHeader() { export default async function guestsTable() { + + function handleInviteGuest() { + fetch("http://localhost:3001/guests/123.json", {method: 'PATCH', body: JSON.stringify({guest: {status: 'Invited'}})}) + .then((response) => console.log(response.json())) + .catch((error) => console.error(error)); + } + let guests: Guest[] = await fetch("http://localhost:3001/guests.json") .then((response) => response.json()) .then((data) => { @@ -81,7 +88,7 @@ export default async function guestsTable() { - {guest.status === 'Considered' && ()}