260322:1648 Correct Coresspondence / Doing RFA / Correct CI
CI Pipeline / build (push) Failing after 12m41s
Build and Deploy / deploy (push) Failing after 2m44s

This commit is contained in:
admin
2026-03-22 16:48:12 +07:00
parent e5deedb42e
commit 11984bfa29
683 changed files with 105251 additions and 29068 deletions
+7 -7
View File
@@ -1,28 +1,28 @@
import apiClient from "@/lib/api/client";
import { DashboardStats, ActivityLog, PendingTask } from "@/types/dashboard";
import apiClient from '@/lib/api/client';
import { DashboardStats, ActivityLog, PendingTask } from '@/types/dashboard';
export const dashboardService = {
getStats: async (): Promise<DashboardStats> => {
const response = await apiClient.get("/dashboard/stats");
const response = await apiClient.get('/dashboard/stats');
return response.data;
},
getRecentActivity: async (): Promise<ActivityLog[]> => {
try {
const response = await apiClient.get("/dashboard/activity");
const response = await apiClient.get('/dashboard/activity');
// ตรวจสอบว่า response.data เป็น array จริงๆ
if (Array.isArray(response.data)) {
return response.data;
}
return [];
} catch (error) {
} catch (_error) {
return [];
}
},
getPendingTasks: async (): Promise<PendingTask[]> => {
try {
const response = await apiClient.get("/dashboard/pending");
const response = await apiClient.get('/dashboard/pending');
// Backend คืน { data: [], meta: {} } ต้องดึง data ออกมา
if (response.data?.data && Array.isArray(response.data.data)) {
return response.data.data;
@@ -31,7 +31,7 @@ export const dashboardService = {
return response.data;
}
return [];
} catch (error) {
} catch (_error) {
return [];
}
},