251208:0010 Backend & Frontend Debug
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
// File: lib/services/shop-drawing.service.ts
|
||||
import apiClient from "@/lib/api/client";
|
||||
import {
|
||||
CreateShopDrawingDto,
|
||||
CreateShopDrawingRevisionDto,
|
||||
SearchShopDrawingDto
|
||||
import {
|
||||
CreateShopDrawingDto,
|
||||
CreateShopDrawingRevisionDto,
|
||||
SearchShopDrawingDto
|
||||
} from "@/types/dto/drawing/shop-drawing.dto";
|
||||
|
||||
export const shopDrawingService = {
|
||||
@@ -11,7 +11,7 @@ export const shopDrawingService = {
|
||||
* ดึงรายการแบบก่อสร้าง (Shop Drawings)
|
||||
*/
|
||||
getAll: async (params: SearchShopDrawingDto) => {
|
||||
const response = await apiClient.get("/shop-drawings", { params });
|
||||
const response = await apiClient.get("/drawings/shop", { params });
|
||||
return response.data;
|
||||
},
|
||||
|
||||
@@ -19,7 +19,7 @@ export const shopDrawingService = {
|
||||
* ดึงรายละเอียดตาม ID (ควรได้ Revision History มาด้วย)
|
||||
*/
|
||||
getById: async (id: string | number) => {
|
||||
const response = await apiClient.get(`/shop-drawings/${id}`);
|
||||
const response = await apiClient.get(`/drawings/shop/${id}`);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
@@ -27,7 +27,7 @@ export const shopDrawingService = {
|
||||
* สร้าง Shop Drawing ใหม่ (พร้อม Revision 0)
|
||||
*/
|
||||
create: async (data: CreateShopDrawingDto) => {
|
||||
const response = await apiClient.post("/shop-drawings", data);
|
||||
const response = await apiClient.post("/drawings/shop", data);
|
||||
return response.data;
|
||||
},
|
||||
|
||||
@@ -35,7 +35,7 @@ export const shopDrawingService = {
|
||||
* สร้าง Revision ใหม่สำหรับ Shop Drawing เดิม
|
||||
*/
|
||||
createRevision: async (id: string | number, data: CreateShopDrawingRevisionDto) => {
|
||||
const response = await apiClient.post(`/shop-drawings/${id}/revisions`, data);
|
||||
const response = await apiClient.post(`/drawings/shop/${id}/revisions`, data);
|
||||
return response.data;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user