changes
This commit is contained in:
@@ -2,11 +2,11 @@
|
||||
import AddIMEIForm from "~/components/imports/AddIMEIForm.vue";
|
||||
import ImportData from "~/components/parameter/ImportData.vue";
|
||||
import { remove } from "es-toolkit";
|
||||
import useActiveCart from "~/components/pos/composables/useActiveCart";
|
||||
|
||||
const props = defineProps({
|
||||
variant: Object,
|
||||
});
|
||||
const store = useStore();
|
||||
const { $getdata, $insertapi, $snackbar } = useNuxtApp();
|
||||
const emit = defineEmits(["close"]);
|
||||
|
||||
@@ -22,7 +22,8 @@ function toggleSelected(imeiRec) {
|
||||
}
|
||||
}
|
||||
|
||||
const { activeCart, activeCartItems, getCarts } = inject("pos");
|
||||
const posStore = usePosStore();
|
||||
const { activeCart, activeCartItems } = useActiveCart();
|
||||
const isAdding = ref(false);
|
||||
|
||||
async function addToCart() {
|
||||
@@ -41,7 +42,7 @@ async function addToCart() {
|
||||
});
|
||||
|
||||
$snackbar(`Đã thêm ${newCartItems.length} sản phẩm vào giỏ hàng`, "Success");
|
||||
getCarts();
|
||||
posStore.getCarts();
|
||||
emit("close");
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
|
||||
Reference in New Issue
Block a user