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,15 +1,14 @@
export default function usePlaceOrder({
activeCart,
activeCartItems,
invalidCartItems,
orderInfo,
fullAddress,
subtotal,
total,
getCarts,
onSuccess,
}) {
import useActiveCart from "~/components/pos/composables/useActiveCart";
import useOrderInfo from "~/components/pos/composables/useOrderInfo";
export default function usePlaceOrder({ onSuccess }) {
const { $dayjs, $id, $getdata, $insertapi, $patchapi, $deleteapi, $snackbar } = useNuxtApp();
const posStore = usePosStore();
const { invalidCartItems, orderInfo } = storeToRefs(posStore);
const { activeCart, activeCartItems, subtotal } = useActiveCart();
const { fullAddress, total } = useOrderInfo();
const isPending = ref(false);
const paidPaymentStatus = ref();
const invoice = ref();
@@ -206,7 +205,7 @@ export default function usePlaceOrder({
customer: null,
}),
]);
getCarts();
posStore.getCarts();
}
async function placeOrder() {