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

@@ -5,7 +5,7 @@ const props = defineProps({
invalid: Boolean,
});
const { $deleteapi, $formatNum, $snackbar } = useNuxtApp();
const { getCarts } = inject("pos");
const posStore = usePosStore();
const showConfirmModal = ref();
const isDeleting = ref(false);
@@ -26,7 +26,7 @@ async function removeFromCart() {
await $deleteapi("Cart_Item", props.cartItem.id);
isDeleting.value = false;
$snackbar("Đã xoá sản phẩm khỏi giỏ hàng", "Success");
getCarts();
posStore.getCarts();
}
</script>
@@ -69,7 +69,7 @@ async function removeFromCart() {
</p>
</div>
<button
v-if="deleteable"
v-if="deleteable || invalid"
@click="openConfirmModal"
:class="['button is-danger is-light', isDeleting && 'is-loading']"
>