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
@@ -152,7 +152,6 @@ export function onSaveImage(xyPostion, index, signKey, imgWH, image) {
return obj;
});
return newUpdateUrl;
// setXyPostion(newUpdateUrl);
}
}
@@ -198,11 +197,13 @@ export const contractDocument = async (documentId) => {
.then((Listdata) => {
const json = Listdata.data;
let data = [];
if (json && json.result) {
if (json && json.result.error) {
return json;
} else if (json && json.result) {
data.push(json.result);
return data;
} else {
return "no data found!";
return [];
}
})
.catch((err) => {
@@ -228,12 +229,13 @@ export const getDrive = async (documentId) => {
.then((Listdata) => {
const json = Listdata.data;
if (json && json.result) {
if (json && json.result.error) {
return json;
} else if (json && json.result) {
const data = json.result;
return data;
} else {
return "no data found!";
return [];
}
})
.catch((err) => {
@@ -258,11 +260,10 @@ export const contractUsers = async (email) => {
.then((Listdata) => {
const json = Listdata.data;
let data = [];
if (json && json.result) {
data.push(json.result);
return data;
} else {
return "no data found!";
}
})
.catch((err) => {