bug(delete) - fixed bug)
This commit is contained in:
@@ -304,7 +304,7 @@ export default function PaymentsRecentTable({
|
||||
onError: (error) => {
|
||||
toast({
|
||||
title: "Error",
|
||||
description: `Failed to delete payment: ${error.message})`,
|
||||
description: `Failed to delete payment: ${error.message}`,
|
||||
variant: "destructive",
|
||||
});
|
||||
},
|
||||
|
||||
@@ -4,7 +4,7 @@ const API_BASE_URL = import.meta.env.VITE_API_BASE_URL_BACKEND ?? "";
|
||||
|
||||
async function throwIfResNotOk(res: Response) {
|
||||
if (!res.ok) {
|
||||
if (res.status === 401 || res.status === 403) {
|
||||
if (res.status === 401) {
|
||||
localStorage.removeItem("token");
|
||||
if (!window.location.pathname.startsWith("/auth")) {
|
||||
window.location.href = "/auth";
|
||||
@@ -87,7 +87,7 @@ export const queryClient = new QueryClient({
|
||||
queryFn: getQueryFn({ on401: "throw" }),
|
||||
refetchInterval: false,
|
||||
refetchOnWindowFocus: false,
|
||||
refetchOnMount: true,
|
||||
refetchOnMount: true,
|
||||
staleTime: 0,
|
||||
retry: false,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user