fix: E mandate validation
This commit is contained in:
@@ -153,11 +153,13 @@ function LoginEmandate() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
console.log("Start to validate soft tech data");
|
||||||
const response = await fetch('/api/e-mandate/validation', {
|
const response = await fetch('/api/e-mandate/validation', {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
'X-Login-Type': 'eMandate',
|
'X-Login-Type': 'eMandate',
|
||||||
|
'Authorization': `Bearer ${localStorage.getItem("mandate_token")}`
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
data: localStorage.getItem("Emendate_data"),
|
data: localStorage.getItem("Emendate_data"),
|
||||||
@@ -167,8 +169,20 @@ function LoginEmandate() {
|
|||||||
});
|
});
|
||||||
const result = await response.json();
|
const result = await response.json();
|
||||||
console.log("Validate Result : ", result);
|
console.log("Validate Result : ", result);
|
||||||
|
if (response.ok) {
|
||||||
router.push("/eMandate/mandate_page");
|
router.push("/eMandate/mandate_page");
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
console.log(result);
|
||||||
|
notifications.show({
|
||||||
|
withBorder: true,
|
||||||
|
color: "red",
|
||||||
|
title: "Validation failed",
|
||||||
|
message: "Failed to validate.Please try again later.",
|
||||||
|
autoClose: 5000,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
regenerateCaptcha();
|
regenerateCaptcha();
|
||||||
|
|||||||
Reference in New Issue
Block a user