feat: เปลี่ยน สถานะของ สินค้าและบริการ

This commit is contained in:
Net 2024-06-24 14:29:31 +07:00
parent fe2fa5e4bc
commit 247549e176
2 changed files with 31 additions and 3 deletions

View file

@ -303,7 +303,7 @@ const useProductServiceStore = defineStore('api-product-service', () => {
}
async function createProduct(data: ProductCreate) {
const { image, ...payload } = data;
const { image, status, ...payload } = data;
const res = await api.post<ProductCreate & { imageUploadUrl: string }>(
'/product',
@ -340,7 +340,7 @@ const useProductServiceStore = defineStore('api-product-service', () => {
async function editProduct(
productId: string,
data: ProductCreate & { status: string },
data: Partial<ProductCreate & { status: string }>,
) {
const { image, code, ...payload } = data;
@ -502,7 +502,10 @@ const useProductServiceStore = defineStore('api-product-service', () => {
}
}
async function editService(serviceId: string, data: ServiceCreate) {
async function editService(
serviceId: string,
data: Partial<ServiceCreate & { status: string }>,
) {
const { image, code, ...payload } = data;
const res = await api.put<ServiceCreate & { imageUploadUrl: string }>(