changes
This commit is contained in:
@@ -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']"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user