fix: E mandate validation
This commit is contained in:
@@ -21,7 +21,7 @@ function LoginEmandate() {
|
||||
const [isLogging, setIsLogging] = useState(false);
|
||||
const searchParams = useSearchParams();
|
||||
const data = searchParams.get("data");
|
||||
const mandateReqDoc= searchParams.get("mandateReqDoc");
|
||||
const mandateReqDoc = searchParams.get("mandateReqDoc");
|
||||
const mndtType = searchParams.get("mndtType");
|
||||
// const payload = searchParams.get("payload");
|
||||
|
||||
@@ -153,22 +153,36 @@ function LoginEmandate() {
|
||||
});
|
||||
}
|
||||
else {
|
||||
console.log("Start to validate soft tech data");
|
||||
const response = await fetch('/api/e-mandate/validation', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'X-Login-Type': 'eMandate',
|
||||
'Authorization': `Bearer ${localStorage.getItem("mandate_token")}`
|
||||
},
|
||||
body: JSON.stringify({
|
||||
data: localStorage.getItem("Emendate_data"),
|
||||
mandateRequest:localStorage.getItem("Emendate_req_doc"),
|
||||
mandateRequest: localStorage.getItem("Emendate_req_doc"),
|
||||
mandateType: localStorage.getItem("Emendate_type"),
|
||||
}),
|
||||
});
|
||||
const result = await response.json();
|
||||
console.log("Validate Result : ",result);
|
||||
console.log("Validate Result : ", result);
|
||||
if (response.ok) {
|
||||
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 {
|
||||
regenerateCaptcha();
|
||||
|
||||
Reference in New Issue
Block a user