fix: ตรวจสอบ status CREATED ก่อนยิง แก้ไข
This commit is contained in:
parent
2848796527
commit
1548558be8
1 changed files with 5 additions and 1 deletions
|
|
@ -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}`,
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue