added in debug and async some calls
This commit is contained in:
@@ -69,11 +69,22 @@ export const getRadioLabel = (data, radiotListName, radioListID) => {
|
||||
* Get the details of a case from the appeal type
|
||||
* @param object searchResultsObj
|
||||
*/
|
||||
export const getSearchDetails = (searchResultsObj) => {
|
||||
export const getSearchDetails = async (searchResultsObj) => {
|
||||
let detailsArr = [];
|
||||
|
||||
searchResultsObj = searchResultsObj.value;
|
||||
const detailsObj = searchResultsObj.map((searchDetail, index) => {
|
||||
let formMeta = getFormCollectionByID(
|
||||
searchDetail.pinswg_appealcasetype
|
||||
);
|
||||
console.log(
|
||||
"------------------- Details: ",
|
||||
formMeta.LogicalCollectionName,
|
||||
searchDetail.title,
|
||||
formMeta.PrimaryIdAttribute,
|
||||
searchDetail.incidentid
|
||||
);
|
||||
|
||||
if (searchDetail.pinswg_appealcasetype == null) {
|
||||
detailsArr.push(
|
||||
getBasicSearchDetails(
|
||||
@@ -81,22 +92,30 @@ export const getSearchDetails = (searchResultsObj) => {
|
||||
searchDetail.title,
|
||||
"pinswg_dnsid",
|
||||
searchDetail.incidentid
|
||||
)
|
||||
) || {
|
||||
"@odata.count": 1,
|
||||
"value": [{ "title": searchDetail.title }],
|
||||
}
|
||||
);
|
||||
} else {
|
||||
let formMeta = getFormCollectionByID(
|
||||
searchDetail.pinswg_appealcasetype
|
||||
);
|
||||
detailsArr.push(
|
||||
getBasicSearchDetails(
|
||||
formMeta.LogicalCollectionName,
|
||||
searchDetail.title,
|
||||
formMeta.PrimaryIdAttribute,
|
||||
searchDetail.incidentid
|
||||
)
|
||||
) || {
|
||||
"@odata.count": 1,
|
||||
"value": [{ "title": searchDetail.title }],
|
||||
}
|
||||
);
|
||||
}
|
||||
});
|
||||
// Promise.all(detailsArr).then((data) => {
|
||||
// console.log(data);
|
||||
// console.log(detailsArr);
|
||||
// return data;
|
||||
// });
|
||||
return Promise.all(detailsArr);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user