fix: ตรวจสอบ status CREATED ก่อนยิง แก้ไข

This commit is contained in:
Net 2024-06-24 16:25:02 +07:00
parent 2848796527
commit 1548558be8

View file

@ -430,7 +430,7 @@ const useProductServiceStore = defineStore('api-product-service', () => {
}
async function createService(data: ServiceCreate) {
const { image, ...payload } = data;
const { image, status, ...payload } = data;
const res = await api.post<ServiceCreate & { imageUploadUrl: string }>(
'/service',
@ -508,6 +508,10 @@ const useProductServiceStore = defineStore('api-product-service', () => {
) {
const { image, code, ...payload } = data;
if (payload.status === 'CREATED') {
delete payload.status;
}
const res = await api.put<ServiceCreate & { imageUploadUrl: string }>(
`/service/${serviceId}`,
{