260318:1401 Fix UUID #05
Build and Deploy / deploy (push) Failing after 11m8s

This commit is contained in:
admin
2026-03-18 14:01:32 +07:00
parent ba642e7e42
commit e5769269a8
37 changed files with 460 additions and 328 deletions
+17 -16
View File
@@ -1,9 +1,9 @@
// File: lib/services/rfa.service.ts
import apiClient from "@/lib/api/client";
import {
CreateRfaDto,
UpdateRfaDto,
SearchRfaDto
import {
CreateRfaDto,
UpdateRfaDto,
SearchRfaDto
} from "@/types/dto/rfa/rfa.dto";
// DTO สำหรับการอนุมัติ (อาจจะย้ายไปไว้ใน folder dto/rfa/ ก็ได้ในอนาคต)
@@ -26,9 +26,9 @@ export const rfaService = {
/**
* ดึงรายละเอียด RFA และประวัติ Workflow
*/
getById: async (id: string | number) => {
// GET /rfas/:id
const response = await apiClient.get(`/rfas/${id}`);
getByUuid: async (uuid: string) => {
// GET /rfas/:uuid (ADR-019)
const response = await apiClient.get(`/rfas/${uuid}`);
return response.data;
},
@@ -44,26 +44,27 @@ export const rfaService = {
/**
* แก้ไข RFA (เฉพาะสถานะ Draft)
*/
update: async (id: string | number, data: UpdateRfaDto) => {
// PUT /rfas/:id
const response = await apiClient.put(`/rfas/${id}`, data);
update: async (uuid: string, data: UpdateRfaDto) => {
// PUT /rfas/:uuid (ADR-019)
const response = await apiClient.put(`/rfas/${uuid}`, data);
return response.data;
},
/**
* ดำเนินการ Workflow (อนุมัติ / ตีกลับ / ส่งต่อ)
*/
processWorkflow: async (id: string | number, actionData: WorkflowActionDto) => {
// POST /rfas/:id/workflow
const response = await apiClient.post(`/rfas/${id}/workflow`, actionData);
processWorkflow: async (uuid: string, actionData: WorkflowActionDto) => {
// POST /rfas/:uuid/workflow (ADR-019)
const response = await apiClient.post(`/rfas/${uuid}/workflow`, actionData);
return response.data;
},
/**
* (Optional) ลบ RFA (Soft Delete)
*/
delete: async (id: string | number) => {
const response = await apiClient.delete(`/rfas/${id}`);
delete: async (uuid: string) => {
// DELETE /rfas/:uuid (ADR-019)
const response = await apiClient.delete(`/rfas/${uuid}`);
return response.data;
}
};
};