260322:1648 Correct Coresspondence / Doing RFA / Correct CI
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
// File: lib/services/correspondence.service.ts
|
||||
import apiClient from "@/lib/api/client";
|
||||
import { SearchCorrespondenceDto } from "@/types/dto/correspondence/search-correspondence.dto";
|
||||
import { CreateCorrespondenceDto } from "@/types/dto/correspondence/create-correspondence.dto";
|
||||
import apiClient from '@/lib/api/client';
|
||||
import { SearchCorrespondenceDto } from '@/types/dto/correspondence/search-correspondence.dto';
|
||||
import { CreateCorrespondenceDto } from '@/types/dto/correspondence/create-correspondence.dto';
|
||||
// Import DTO ใหม่
|
||||
import { SubmitCorrespondenceDto } from "@/types/dto/correspondence/submit-correspondence.dto";
|
||||
import { WorkflowActionDto } from "@/types/dto/correspondence/workflow-action.dto";
|
||||
import { AddReferenceDto, RemoveReferenceDto } from "@/types/dto/correspondence/add-reference.dto";
|
||||
import { SubmitCorrespondenceDto } from '@/types/dto/correspondence/submit-correspondence.dto';
|
||||
import { WorkflowActionDto } from '@/types/dto/correspondence/workflow-action.dto';
|
||||
import { AddReferenceDto, RemoveReferenceDto } from '@/types/dto/correspondence/add-reference.dto';
|
||||
|
||||
export const correspondenceService = {
|
||||
// ... (getAll, getById, create, update, delete เดิมคงไว้) ...
|
||||
|
||||
getAll: async (params?: SearchCorrespondenceDto) => {
|
||||
const response = await apiClient.get("/correspondences", { params });
|
||||
const response = await apiClient.get('/correspondences', { params });
|
||||
return response.data;
|
||||
},
|
||||
|
||||
@@ -21,7 +21,7 @@ export const correspondenceService = {
|
||||
},
|
||||
|
||||
create: async (data: CreateCorrespondenceDto) => {
|
||||
const response = await apiClient.post("/correspondences", data);
|
||||
const response = await apiClient.post('/correspondences', data);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
@@ -67,7 +67,7 @@ export const correspondenceService = {
|
||||
removeReference: async (uuid: string, data: RemoveReferenceDto) => {
|
||||
// ใช้ DELETE method โดยส่ง body ไปด้วย (axios รองรับผ่าน config.data)
|
||||
const response = await apiClient.delete(`/correspondences/${uuid}/references`, {
|
||||
data: data
|
||||
data: data,
|
||||
});
|
||||
return response.data;
|
||||
},
|
||||
@@ -75,7 +75,7 @@ export const correspondenceService = {
|
||||
* Preview Document Number
|
||||
*/
|
||||
previewNumber: async (data: Partial<CreateCorrespondenceDto>) => {
|
||||
const response = await apiClient.post("/correspondences/preview-number", data);
|
||||
const response = await apiClient.post('/correspondences/preview-number', data);
|
||||
return response.data;
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user