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);