260320:1131 Refactor Overrall #01
Build and Deploy / deploy (push) Has been cancelled

This commit is contained in:
admin
2026-03-20 11:31:27 +07:00
parent f1b81a7d0d
commit 1d3479770b
147 changed files with 1745 additions and 1567 deletions
+2 -2
View File
@@ -41,7 +41,7 @@ apiClient.interceptors.request.use(
}
}
} catch (error) {
console.warn("Failed to retrieve auth token:", error);
// Auth token retrieval failed - request will proceed without token
}
}
@@ -66,7 +66,7 @@ apiClient.interceptors.response.use(
// กรณี Token หมดอายุ หรือ ไม่มีสิทธิ์
if (status === 401) {
console.error("Unauthorized: Please login again.");
// Unauthorized: redirect handled by auth interceptor
// สามารถเพิ่ม Logic Redirect ไปหน้า Login ได้ถ้าต้องการ
}
}
-1
View File
@@ -300,7 +300,6 @@ export const numberingApi = {
): Promise<{ number: string }> => {
// Fallback mock for legacy UI - requires proper context for real use
const mockNumber = `TEST-${new Date().getFullYear()}-${String(Math.floor(Math.random() * 9999)).padStart(4, '0')}`;
console.log('Using mock generateTestNumber. Context:', context);
return { number: mockNumber };
},
};
+1 -5
View File
@@ -47,7 +47,7 @@ async function refreshAccessToken(token: JWT) {
refreshToken: data.refresh_token ?? token.refreshToken,
};
} catch (error) {
console.log("RefreshAccessTokenError", error);
// RefreshAccessTokenError - token will be invalidated
return {
...token,
@@ -73,7 +73,6 @@ export const {
try {
const { username, password } = await loginSchema.parseAsync(credentials);
console.log(`Attempting login to: ${baseUrl}/auth/login`);
const res = await fetch(`${baseUrl}/auth/login`, {
method: "POST",
@@ -83,7 +82,6 @@ export const {
if (!res.ok) {
const errorMsg = await res.text();
console.error("Login failed:", errorMsg);
return null;
}
@@ -91,7 +89,6 @@ export const {
const backendData = responseJson.data || responseJson;
if (!backendData || !backendData.access_token) {
console.error("No access token received");
return null;
}
@@ -107,7 +104,6 @@ export const {
} as User;
} catch (error) {
console.error("Auth error:", error);
return null;
}
},
@@ -14,10 +14,8 @@ export const dashboardService = {
if (Array.isArray(response.data)) {
return response.data;
}
console.warn('Dashboard activity: expected array, got:', typeof response.data);
return [];
} catch (error) {
console.error('Failed to fetch recent activity:', error);
return [];
}
},
@@ -32,10 +30,8 @@ export const dashboardService = {
if (Array.isArray(response.data)) {
return response.data;
}
console.warn('Dashboard pending: unexpected format:', typeof response.data);
return [];
} catch (error) {
console.error('Failed to fetch pending tasks:', error);
return [];
}
},