Fix react-query onError type error

The `onError` option was not correctly typed in the react-query configuration. This commit updates the type definition to resolve the TypeScript error.
This commit is contained in:
gpt-engineer-app[bot]
2025-03-15 05:19:47 +00:00
parent 3bb4781ff0
commit 78fda7e228

View File

@@ -39,15 +39,19 @@ const queryClient = new QueryClient({
queries: {
retry: 1,
refetchOnWindowFocus: false,
// 오류 처리 추가
onError: (error) => {
console.error("쿼리 오류:", error);
meta: {
// meta 객체를 사용하여 오류 관리
errorHandler: (error: Error) => {
console.error("쿼리 오류:", error);
}
}
},
mutations: {
// 오류 처리 추가
onError: (error) => {
console.error("뮤테이션 오류:", error);
// onSettled를 사용하여 완료 시 호출되는 콜백 설정
onSettled: (_data, error) => {
if (error) {
console.error("뮤테이션 오류:", error);
}
}
}
},