Feature: Mark guests as invited #60

Merged
bustikiller merged 9 commits from guest-status-changes into main 2024-10-27 18:28:22 +00:00
Showing only changes of commit 45e2665997 - Show all commits

View File

@ -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<HTMLElement>) => {
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() {
</span>
</td>
<td>
{guest.status === 'Considered' && (<button onClick={handleInviteGuest} className="bg-blue-300 hover:bg-blue-500 text-white py-1 px-2 rounded">
{guest.status === 'Considered' && (<button data-guest-id={guest.id} onClick={handleInviteGuest} className="bg-blue-300 hover:bg-blue-500 text-white py-1 px-2 rounded">
Invite
</button>)}
</td>