This commit is contained in:
@@ -277,14 +277,16 @@ const paymentHandler = async (id) => {
|
||||
const data = await useFetch("/api/user/registerCourse", {
|
||||
method: "POST",
|
||||
body: {
|
||||
courseId: id,
|
||||
code: "",
|
||||
courseId: id
|
||||
},
|
||||
});
|
||||
if (data?.data?.value?.status === 406 || data?.data?.value?.status === 500) {
|
||||
toast.error(data?.data?.value?.message);
|
||||
} else {
|
||||
console.log(data?.data?.value?.paymentData?.redirectUrl);
|
||||
if (data?.data?.value?.payment?.authority === 'FREE') {
|
||||
toast.success("ثبت نام انجام شد");
|
||||
navigateTo('/account/my-courses')
|
||||
|
||||
} else {
|
||||
location.href = data?.data?.value?.paymentData?.redirectUrl
|
||||
}
|
||||
// setTimeout(() => {
|
||||
// location.reload();
|
||||
|
||||
Reference in New Issue
Block a user