chore(WEB): actions.ts 에러 핸들링 및 CEO 대시보드 개선
- 전체 모듈 actions.ts redirect 에러 핸들링 추가 - CEODashboard DetailModal 추가 - MonthlyExpenseSection 개선 - fetch-wrapper redirect 에러 처리 - redirect-error 유틸 추가 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
'use server';
|
||||
|
||||
|
||||
import { isRedirectError } from 'next/dist/client/components/redirect';
|
||||
import { isNextRedirectError } from '@/lib/utils/redirect-error';
|
||||
/**
|
||||
* 검사 관리 Server Actions
|
||||
* API 연동 완료 (2025-12-26)
|
||||
@@ -265,7 +265,7 @@ export async function getInspections(params?: {
|
||||
},
|
||||
};
|
||||
} catch (error) {
|
||||
if (isRedirectError(error)) throw error;
|
||||
if (isNextRedirectError(error)) throw error;
|
||||
console.error('[InspectionActions] getInspections error:', error);
|
||||
return {
|
||||
success: false,
|
||||
@@ -349,7 +349,7 @@ export async function getInspectionStats(params?: {
|
||||
},
|
||||
};
|
||||
} catch (error) {
|
||||
if (isRedirectError(error)) throw error;
|
||||
if (isNextRedirectError(error)) throw error;
|
||||
console.error('[InspectionActions] getInspectionStats error:', error);
|
||||
return {
|
||||
success: false,
|
||||
@@ -411,7 +411,7 @@ export async function getInspectionById(id: string): Promise<{
|
||||
data: transformApiToFrontend(result.data),
|
||||
};
|
||||
} catch (error) {
|
||||
if (isRedirectError(error)) throw error;
|
||||
if (isNextRedirectError(error)) throw error;
|
||||
console.error('[InspectionActions] getInspectionById error:', error);
|
||||
return {
|
||||
success: false,
|
||||
@@ -498,7 +498,7 @@ export async function createInspection(data: {
|
||||
data: transformApiToFrontend(result.data),
|
||||
};
|
||||
} catch (error) {
|
||||
if (isRedirectError(error)) throw error;
|
||||
if (isNextRedirectError(error)) throw error;
|
||||
console.error('[InspectionActions] createInspection error:', error);
|
||||
return {
|
||||
success: false,
|
||||
@@ -590,7 +590,7 @@ export async function updateInspection(
|
||||
data: transformApiToFrontend(result.data),
|
||||
};
|
||||
} catch (error) {
|
||||
if (isRedirectError(error)) throw error;
|
||||
if (isNextRedirectError(error)) throw error;
|
||||
console.error('[InspectionActions] updateInspection error:', error);
|
||||
return {
|
||||
success: false,
|
||||
@@ -640,7 +640,7 @@ export async function deleteInspection(id: string): Promise<{
|
||||
|
||||
return { success: true };
|
||||
} catch (error) {
|
||||
if (isRedirectError(error)) throw error;
|
||||
if (isNextRedirectError(error)) throw error;
|
||||
console.error('[InspectionActions] deleteInspection error:', error);
|
||||
return {
|
||||
success: false,
|
||||
@@ -708,7 +708,7 @@ export async function completeInspection(
|
||||
data: transformApiToFrontend(result.data),
|
||||
};
|
||||
} catch (error) {
|
||||
if (isRedirectError(error)) throw error;
|
||||
if (isNextRedirectError(error)) throw error;
|
||||
console.error('[InspectionActions] completeInspection error:', error);
|
||||
return {
|
||||
success: false,
|
||||
|
||||
Reference in New Issue
Block a user