changes
This commit is contained in:
@@ -66,11 +66,16 @@ async function createOrder() {
|
||||
|
||||
$snackbar("Tạo đơn hàng thành công", "Success");
|
||||
|
||||
await Promise.all(cartItems.value.map(({ id }) => $deleteapi("Cart_Item", id)));
|
||||
await $patchapi("Cart", {
|
||||
id: cartItems.value[0].cart,
|
||||
customer: null,
|
||||
});
|
||||
await Promise.all([
|
||||
$deleteapi(
|
||||
"Cart_Item",
|
||||
cartItems.value.map((c) => c.id),
|
||||
),
|
||||
$patchapi("Cart", {
|
||||
id: cartItems.value[0].cart,
|
||||
customer: null,
|
||||
}),
|
||||
]);
|
||||
getCart();
|
||||
emit("close");
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user