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:
@@ -8,7 +8,7 @@
|
||||
'use server';
|
||||
|
||||
|
||||
import { isRedirectError } from 'next/dist/client/components/redirect';
|
||||
import { isNextRedirectError } from '@/lib/utils/redirect-error';
|
||||
import { serverFetch } from '@/lib/api/fetch-wrapper';
|
||||
import type { WorkOrder, WorkOrderStatus } from '../ProductionDashboard/types';
|
||||
|
||||
@@ -133,7 +133,7 @@ export async function getMyWorkOrders(): Promise<{
|
||||
data: workOrders,
|
||||
};
|
||||
} catch (error) {
|
||||
if (isRedirectError(error)) throw error;
|
||||
if (isNextRedirectError(error)) throw error;
|
||||
console.error('[WorkerScreenActions] getMyWorkOrders error:', error);
|
||||
return {
|
||||
success: false,
|
||||
@@ -186,7 +186,7 @@ export async function completeWorkOrder(
|
||||
lotNo,
|
||||
};
|
||||
} catch (error) {
|
||||
if (isRedirectError(error)) throw error;
|
||||
if (isNextRedirectError(error)) throw error;
|
||||
console.error('[WorkerScreenActions] completeWorkOrder error:', error);
|
||||
return {
|
||||
success: false,
|
||||
@@ -270,7 +270,7 @@ export async function getMaterialsForWorkOrder(
|
||||
data: materials,
|
||||
};
|
||||
} catch (error) {
|
||||
if (isRedirectError(error)) throw error;
|
||||
if (isNextRedirectError(error)) throw error;
|
||||
console.error('[WorkerScreenActions] getMaterialsForWorkOrder error:', error);
|
||||
return {
|
||||
success: false,
|
||||
@@ -313,7 +313,7 @@ export async function registerMaterialInput(
|
||||
|
||||
return { success: true };
|
||||
} catch (error) {
|
||||
if (isRedirectError(error)) throw error;
|
||||
if (isNextRedirectError(error)) throw error;
|
||||
console.error('[WorkerScreenActions] registerMaterialInput error:', error);
|
||||
return {
|
||||
success: false,
|
||||
@@ -359,7 +359,7 @@ export async function reportIssue(
|
||||
|
||||
return { success: true };
|
||||
} catch (error) {
|
||||
if (isRedirectError(error)) throw error;
|
||||
if (isNextRedirectError(error)) throw error;
|
||||
console.error('[WorkerScreenActions] reportIssue error:', error);
|
||||
return {
|
||||
success: false,
|
||||
@@ -471,7 +471,7 @@ export async function getProcessSteps(
|
||||
data: steps,
|
||||
};
|
||||
} catch (error) {
|
||||
if (isRedirectError(error)) throw error;
|
||||
if (isNextRedirectError(error)) throw error;
|
||||
console.error('[WorkerScreenActions] getProcessSteps error:', error);
|
||||
return {
|
||||
success: false,
|
||||
@@ -514,7 +514,7 @@ export async function requestInspection(
|
||||
|
||||
return { success: true };
|
||||
} catch (error) {
|
||||
if (isRedirectError(error)) throw error;
|
||||
if (isNextRedirectError(error)) throw error;
|
||||
console.error('[WorkerScreenActions] requestInspection error:', error);
|
||||
return {
|
||||
success: false,
|
||||
|
||||
Reference in New Issue
Block a user