diff --git a/src/components/accounting/PurchaseManagement/actions.ts b/src/components/accounting/PurchaseManagement/actions.ts index f9f9ed65..2f5fed08 100644 --- a/src/components/accounting/PurchaseManagement/actions.ts +++ b/src/components/accounting/PurchaseManagement/actions.ts @@ -307,7 +307,15 @@ export async function togglePurchaseTaxInvoice( id: string, value: boolean ): Promise<{ success: boolean; data?: PurchaseRecord; error?: string }> { - return updatePurchase(id, { taxInvoiceReceived: value }); + try { + return await updatePurchase(id, { taxInvoiceReceived: value }); + } catch (error) { + // 인증 만료 등으로 인한 리다이렉트 에러 → 페이지 이동 없이 에러 반환 + if (isNextRedirectError(error)) { + return { success: false, error: '세션이 만료되었습니다. 다시 로그인해주세요.' }; + } + throw error; + } } // ===== 매입 삭제 ===== diff --git a/src/components/templates/UniversalListPage/index.tsx b/src/components/templates/UniversalListPage/index.tsx index 740803ed..58a1e236 100644 --- a/src/components/templates/UniversalListPage/index.tsx +++ b/src/components/templates/UniversalListPage/index.tsx @@ -205,9 +205,11 @@ export function UniversalListPage({ }, [config.tabs]); // 데이터 변경 콜백 (동적 컬럼 계산 등에 사용) + // ⚠️ config.onDataChange를 deps에서 제외: 콜백 참조 변경으로 인한 무한 루프 방지 useEffect(() => { config.onDataChange?.(rawData); - }, [rawData, config.onDataChange]); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [rawData]); // 서버 사이드 필터링: 의존성 변경 시 데이터 새로고침 // 이전 페이지를 추적하여 모바일 인피니티 스크롤 감지