Skip to content
This repository was archived by the owner on Jan 28, 2026. It is now read-only.

Commit 85232e2

Browse files
author
ge85riz
committed
🐛 fix(frontend): don't throw success toast if unseating the participants fails
1 parent bebdb04 commit 85232e2

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

frontend/src/pages/Events/EventSeatAllocation.tsx

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -224,13 +224,14 @@ const SeatAllocationContent = ({
224224
try {
225225
setLoading(true);
226226
setShowUnseatAllConfirmModal(false);
227-
unsetAllSeatAllocations(eventId).then(() => {
228-
229-
participants.forEach(p => {
230-
p.chairId = null;
231-
});
232-
setParticipants([...participants]);
233-
toast.success("All Participants are unseated successfully!");
227+
unsetAllSeatAllocations(eventId).then((result) => {
228+
if (result) {
229+
participants.forEach(p => {
230+
p.chairId = null;
231+
});
232+
setParticipants([...participants]);
233+
toast.success("All Participants are unseated successfully!");
234+
}
234235
});
235236
} finally {
236237
setLoading(false);

frontend/src/services/apiService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ export default function useApiService() {
560560

561561
const unsetAllSeatAllocations = useCallback(async (eventId: string) => {
562562
try {
563-
return await request<void>(`/seat-allocation/${eventId}/unsetAllChairs`);
563+
return await request<boolean>(`/seat-allocation/${eventId}/unsetAllChairs`);
564564
} catch (err) {
565565
toast.error("Unsetting of all seat allocations for this event failed");
566566
}

0 commit comments

Comments
 (0)