251209:1453 Frontend: progress nest = UAT & Bug Fixing
Some checks failed
Spec Validation / validate-markdown (push) Has been cancelled
Spec Validation / validate-diagrams (push) Has been cancelled
Spec Validation / check-todos (push) Has been cancelled

This commit is contained in:
admin
2025-12-09 14:53:42 +07:00
parent 8aceced902
commit aa96cd90e3
125 changed files with 11052 additions and 785 deletions

View File

@@ -14,7 +14,8 @@ export const masterDataService = {
/** ดึงรายการ Tags ทั้งหมด (Search & Pagination) */
getTags: async (params?: SearchTagDto) => {
const response = await apiClient.get("/tags", { params });
return response.data;
// Support both wrapped and unwrapped scenarios
return response.data.data || response.data;
},
/** สร้าง Tag ใหม่ */
@@ -39,8 +40,8 @@ export const masterDataService = {
/** ดึงรายชื่อองค์กรทั้งหมด */
getOrganizations: async () => {
const response = await apiClient.get<Organization[]>("/organizations");
return response.data;
const response = await apiClient.get<any>("/organizations");
return response.data.data || response.data;
},
/** สร้างองค์กรใหม่ */
@@ -69,7 +70,7 @@ export const masterDataService = {
const response = await apiClient.get("/master/disciplines", {
params: { contractId }
});
return response.data;
return response.data.data || response.data;
},
/** สร้างสาขางานใหม่ */
@@ -78,6 +79,12 @@ export const masterDataService = {
return response.data;
},
/** ลบสาขางาน */
deleteDiscipline: async (id: number) => {
const response = await apiClient.delete(`/master/disciplines/${id}`);
return response.data;
},
// --- Sub-Types Management (Admin / Req 6B) ---
/** ดึงรายชื่อประเภทย่อย (กรองตาม Contract และ Type) */
@@ -85,7 +92,7 @@ export const masterDataService = {
const response = await apiClient.get("/master/sub-types", {
params: { contractId, correspondenceTypeId: typeId }
});
return response.data;
return response.data.data || response.data;
},
/** สร้างประเภทย่อยใหม่ */