new changes

This commit is contained in:
Mamalizz
2025-03-27 23:07:02 +03:30
parent fb21b8f309
commit 9687f5143b
@@ -21,17 +21,19 @@ const discountCode = ref(cart.value?.discount_code?.code || "");
const {
mutateAsync: submitDiscountCode,
isPending: submitDiscountCodeIsPending
isPending: submitDiscountCodeIsPending,
} = useSubmitDiscountCode();
const {
mutateAsync: deleteDiscountCode,
isPending: deleteDiscountCodeIsPending
isPending: deleteDiscountCodeIsPending,
} = useDeleteDiscountCode();
// computed
const nextPage = computed(() => route.meta.nextPage as { name: string; label: string } | undefined);
const nextPage = computed(
() => route.meta.nextPage as { name: string; label: string } | undefined
);
const hasSubmittedDiscountCode = computed(() => !!cart.value?.discount_code);
@@ -48,11 +50,11 @@ const handleSubmitDiscountCode = () => {
addToast({
message: "خطایی در ثبت کد تخفیف رخ داد",
options: {
status: "error"
}
status: "error",
},
});
discountCode.value = "";
}
},
}
);
};
@@ -67,11 +69,11 @@ const handleDeleteDiscountCode = () => {
addToast({
message: "خطایی در حذف کد تخفیف رخ داد",
options: {
status: "error"
}
status: "error",
},
});
discountCode.value = "";
}
},
});
};
</script>