fix: 매입관리 세금계산서 토글 오류 수정

- togglePurchaseTaxInvoice에서 redirect 에러 catch하여 페이지 이동 방지
- UniversalListPage의 onDataChange useEffect 무한 루프 수정
  - config.onDataChange를 dependency array에서 제거
This commit is contained in:
2026-01-23 13:31:18 +09:00
parent 297c6b7ef6
commit f4352ca8c1
2 changed files with 12 additions and 2 deletions

View File

@@ -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;
}
}
// ===== 매입 삭제 =====