changes
This commit is contained in:
@@ -8,8 +8,11 @@ const props = defineProps({
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<h1 class="subtitle">Sản phẩm</h1>
|
||||
<ProductForm :variantId="variant.id" />
|
||||
<h1 class="subtitle">Phiên bản</h1>
|
||||
<ProductVariantForm :variantId="variant.id" />
|
||||
<div>
|
||||
<h1 class="subtitle">Sản phẩm</h1>
|
||||
<ProductForm :variantId="variant.id" />
|
||||
<hr />
|
||||
<h1 class="subtitle">Phiên bản</h1>
|
||||
<ProductVariantForm :variantId="variant.id" />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -24,10 +24,10 @@ function toggleSelected(imeiRec) {
|
||||
|
||||
const { cartItems, getCart } = inject("pos");
|
||||
const isAdding = ref(false);
|
||||
|
||||
async function addToCart() {
|
||||
try {
|
||||
isAdding.value = true;
|
||||
console.log("store.customer", store.customer);
|
||||
let cart = await $getdata("Cart", {
|
||||
filter: { customer: store.customer },
|
||||
first: true,
|
||||
|
||||
@@ -66,11 +66,16 @@ async function createOrder() {
|
||||
|
||||
$snackbar("Tạo đơn hàng thành công", "Success");
|
||||
|
||||
await Promise.all(cartItems.value.map(({ id }) => $deleteapi("Cart_Item", id)));
|
||||
await $patchapi("Cart", {
|
||||
id: cartItems.value[0].cart,
|
||||
customer: null,
|
||||
});
|
||||
await Promise.all([
|
||||
$deleteapi(
|
||||
"Cart_Item",
|
||||
cartItems.value.map((c) => c.id),
|
||||
),
|
||||
$patchapi("Cart", {
|
||||
id: cartItems.value[0].cart,
|
||||
customer: null,
|
||||
}),
|
||||
]);
|
||||
getCart();
|
||||
emit("close");
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user