From 45e2665997403eaf69121c36f11eaeab71a69d8f Mon Sep 17 00:00:00 2001 From: Manuel Bustillo Date: Sun, 27 Oct 2024 12:05:35 +0100 Subject: [PATCH] Pass the ID of the guests that has just been invited --- app/ui/guests/table.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/ui/guests/table.tsx b/app/ui/guests/table.tsx index 9205a65..66b2919 100644 --- a/app/ui/guests/table.tsx +++ b/app/ui/guests/table.tsx @@ -27,8 +27,8 @@ export default function guestsTable() { }; - function handleInviteGuest() { - fetch("http://localhost:3001/guests/bulk-status-change.json", { method: 'POST', body: JSON.stringify({ status: "Invited", guest_ids: [] }) }) + const handleInviteGuest = (e: React.MouseEvent) => { + fetch("http://localhost:3001/guests/bulk-status-change.json", { method: 'POST', body: JSON.stringify({ status: "Invited", guest_ids: [e.currentTarget.getAttribute('data-guest-id')] }) }) .then((response) => console.log(response.json())) .catch((error) => console.error(error)); } @@ -91,7 +91,7 @@ export default function guestsTable() { - {guest.status === 'Considered' && ()}