This commit is contained in:
Viet An
2026-06-30 15:12:04 +07:00
parent 8b3da71895
commit e9e4fbe24f
18 changed files with 149 additions and 158 deletions

View File

@@ -1,5 +1,9 @@
<script setup>
const { carts, activeCartId, activeCartItems, isChangingCus, getCarts } = inject("pos");
import useActiveCart from "~/components/pos/composables/useActiveCart";
const posStore = usePosStore();
const { carts, activeCartId, isChangingCus } = storeToRefs(posStore);
const { activeCartItems } = useActiveCart();
const { $insertapi, $deleteapi } = useNuxtApp();
const isAddingCart = ref(false);
@@ -9,7 +13,7 @@ async function addCart() {
const newCart = await $insertapi("Cart", { notify: false });
activeCartId.value = newCart.id;
isAddingCart.value = false;
getCarts();
posStore.getCarts();
}
const isDeletingCart = ref();
@@ -36,7 +40,7 @@ async function removeCart(cartId) {
}
}
}
getCarts();
posStore.getCarts();
}
</script>