From 3b6f1a45917d514a142c9584cb959fb7099feada Mon Sep 17 00:00:00 2001 From: Nicholas Tindle Date: Sun, 8 Feb 2026 20:55:10 -0600 Subject: [PATCH] fix(frontend): check response status in delete mutation Consistent with other mutations, now checks response.status === 200 before showing success toast. Co-Authored-By: Claude Opus 4.5 --- .../waitlist/components/WaitlistTable.tsx | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/autogpt_platform/frontend/src/app/(platform)/admin/waitlist/components/WaitlistTable.tsx b/autogpt_platform/frontend/src/app/(platform)/admin/waitlist/components/WaitlistTable.tsx index ad47fb3a4e..7b17319c66 100644 --- a/autogpt_platform/frontend/src/app/(platform)/admin/waitlist/components/WaitlistTable.tsx +++ b/autogpt_platform/frontend/src/app/(platform)/admin/waitlist/components/WaitlistTable.tsx @@ -33,14 +33,22 @@ export function WaitlistTable() { const deleteWaitlistMutation = useDeleteV2DeleteWaitlist({ mutation: { - onSuccess: () => { - toast({ - title: "Success", - description: "Waitlist deleted successfully", - }); - queryClient.invalidateQueries({ - queryKey: getGetV2ListAllWaitlistsQueryKey(), - }); + onSuccess: (response) => { + if (response.status === 200) { + toast({ + title: "Success", + description: "Waitlist deleted successfully", + }); + queryClient.invalidateQueries({ + queryKey: getGetV2ListAllWaitlistsQueryKey(), + }); + } else { + toast({ + variant: "destructive", + title: "Error", + description: "Failed to delete waitlist", + }); + } }, onError: (error) => { console.error("Error deleting waitlist:", error);