fix: Product แก้สถานะ

This commit is contained in:
Net 2024-06-20 13:58:42 +07:00
parent 3fca025af8
commit 39ba6b7c3b
2 changed files with 11 additions and 3 deletions

View file

@ -15,6 +15,7 @@ defineProps<{
price?: number;
process?: number;
id?: string;
status?: boolean;
}>();
</script>
@ -24,7 +25,7 @@ defineProps<{
bordered
style="box-shadow: var(--shadow-3); width: 240px; height: 286px"
>
<div class="q-pa-sm">
<div class="q-pa-sm" :class="{ inactive: status }">
<div class="row flex justify-between text-bold">
<div class="col-9">{{ title ?? 'title' }}</div>
<div class="col-3 relative-position" style="left: 10px; bottom: 10px">
@ -168,4 +169,8 @@ defineProps<{
</AppBox>
</template>
<style scoped></style>
<style scoped>
.inactive {
opacity: 0.4;
}
</style>

View file

@ -329,7 +329,10 @@ const useProductServiceStore = defineStore('api-product-service', () => {
}
}
async function editProduct(productId: string, data: ProductCreate) {
async function editProduct(
productId: string,
data: ProductCreate & { status: string },
) {
const { image, code, ...payload } = data;
const res = await api.put<ProductCreate & { imageUploadUrl: string }>(