handle condition of no data for contracts_Document and contracts_ContactBook classes

This commit is contained in:
RaktimaNXG
2023-11-20 21:57:26 +05:30
parent 910bd801ac
commit b178a3c91e
7 changed files with 93 additions and 85 deletions
@@ -176,7 +176,7 @@ function PlaceHolderSign() {
const getDocumentDetails = async () => {
//getting document details
const documentData = await contractDocument(documentId);
if (documentData && documentData !== "no data found!" && documentData[0]) {
if (documentData && documentData.length > 0) {
setPdfDetails(documentData);
const currEmail = documentData[0].ExtUserPtr.Email;
@@ -190,19 +190,22 @@ function PlaceHolderSign() {
setSignerObjId(documentData[0].Signers[0].objectId);
setContractName(documentData[0].Signers[0].className);
setIsSelectId(0);
} else if (documentData === "no data found!") {
} else if (
documentData === "Error: Something went wrong!" ||
(documentData.result && documentData.result.error)
) {
const loadObj = {
isLoad: false
};
setHandleError("Error: Something went wrong!");
setIsLoading(loadObj);
} else {
setNoData(true);
const loadObj = {
isLoad: false
};
setIsLoading(loadObj);
} else if (documentData === "Error: Something went wrong!") {
const loadObj = {
isLoad: false
};
setHandleError("Error: Something went wrong!");
setIsLoading(loadObj);
}
const res = await contractUsers(jsonSender.email);
if (res[0] && res.length) {