partial synch with ph2 updates
This commit is contained in:
+154
-38
@@ -389,7 +389,7 @@ export const getDNSCoords = () => {
|
||||
});
|
||||
};
|
||||
|
||||
export const getDNSList = async (searchString) => {
|
||||
export const getDNSList = (searchString) => {
|
||||
return axios
|
||||
.get(BASE_URL + "/api/endpoint/getdnslist_api")
|
||||
.then((res) => res.data)
|
||||
@@ -544,23 +544,42 @@ export const getBasicSearchDetailsPaged = async (
|
||||
appealTypeName,
|
||||
caseReference,
|
||||
primaryIdAttribute,
|
||||
incidentID
|
||||
incidentIDs
|
||||
) => {
|
||||
//console.log("check appealtype:", appealType, caseReference);
|
||||
if (!incidentIDs || incidentIDs.length === 0) return [];
|
||||
|
||||
return axios
|
||||
.get(
|
||||
"/api/endpoint/getbasicsearchdetailspaged_api?appealTypeName=" +
|
||||
appealTypeName +
|
||||
"&primaryIdAttribute=" +
|
||||
primaryIdAttribute +
|
||||
"&incidentID=" +
|
||||
incidentID
|
||||
)
|
||||
.then((res) => res.data)
|
||||
.catch((error) => {
|
||||
consoleLogger(error);
|
||||
});
|
||||
console.log("=======", primaryIdAttribute);
|
||||
// Build OData filter correctly
|
||||
// const filter = incidentIDs
|
||||
// .map((id) => `_${primaryIdAttribute}s_value eq ${id}`)
|
||||
// .join(" or ");
|
||||
|
||||
const filter = incidentIDs
|
||||
.map((id) => {
|
||||
const suffix =
|
||||
primaryIdAttribute === "pinswg_sipscase"
|
||||
? `_${primaryIdAttribute}_value`
|
||||
: `_${primaryIdAttribute}s_value`;
|
||||
|
||||
return `${suffix} eq ${id}`;
|
||||
})
|
||||
.join(" or ");
|
||||
|
||||
const url = `/api/endpoint/getbasicsearchdetailspaged_api?appealTypeName=${appealTypeName}&primaryIdAttribute=${primaryIdAttribute}&incidentID=${encodeURIComponent(
|
||||
filter
|
||||
)}`;
|
||||
|
||||
console.log(
|
||||
`Fetching ${incidentIDs.length} incidents for appeal type: ${appealTypeName}`
|
||||
);
|
||||
|
||||
try {
|
||||
const res = await axios.get(url);
|
||||
return res.data.value || []; // ensure returning an array
|
||||
} catch (error) {
|
||||
consoleLogger(error);
|
||||
return [];
|
||||
}
|
||||
};
|
||||
|
||||
export const getSearchDocumentDetails = (incidentID) => {
|
||||
@@ -828,6 +847,19 @@ export const getMyCases = (loggedInUserId) => {
|
||||
});
|
||||
};
|
||||
|
||||
export const getMyInvolvements = async (loggedInUserId) => {
|
||||
try {
|
||||
const res = await axios.get(
|
||||
BASE_URL +
|
||||
"/api/endpoint/getmyinvolvements_api?loggedInUserId=" +
|
||||
loggedInUserId
|
||||
);
|
||||
return res.data;
|
||||
} catch (error) {
|
||||
consoleLogger(error);
|
||||
}
|
||||
};
|
||||
|
||||
export const getMyLPACases = (lpaid) => {
|
||||
return axios
|
||||
.get(BASE_URL + "/api/endpoint/getmylpacases_api?lpaid=" + lpaid)
|
||||
@@ -1492,23 +1524,20 @@ export const deleteMyRepresentationsFromBlob = (
|
||||
});
|
||||
};
|
||||
|
||||
export const deleteWatchedCases = (watchedCaseID) => {
|
||||
export const deleteWatchedCases = async (watchedCaseID) => {
|
||||
var queryUrl =
|
||||
"/api/endpoint/deletewatchedcasesproxy_api?watchedCaseID=" +
|
||||
watchedCaseID;
|
||||
"/api/endpoint/deletewatchedcases_api?watchedCaseID=" + watchedCaseID;
|
||||
var config = {
|
||||
method: "get",
|
||||
method: "delete",
|
||||
url: queryUrl,
|
||||
};
|
||||
|
||||
return axios(config)
|
||||
.then((res) => {
|
||||
//console.log("deleted ", res.data);
|
||||
return res.data;
|
||||
})
|
||||
.catch((error) => {
|
||||
consoleLogger(error);
|
||||
});
|
||||
try {
|
||||
const res = await axios(config);
|
||||
return res.data;
|
||||
} catch (error) {
|
||||
consoleLogger(error);
|
||||
}
|
||||
};
|
||||
|
||||
export const createAccount = (formValues) => {
|
||||
@@ -1813,9 +1842,9 @@ export const deleteBlob = async (
|
||||
"/api/file/deleteblob?container=" +
|
||||
containerName +
|
||||
"&casefolderID=" +
|
||||
casefolderID +
|
||||
encodeURIComponent(casefolderID) +
|
||||
"&blobname=" +
|
||||
blobName +
|
||||
encodeURIComponent(blobName) +
|
||||
deleteblobhash
|
||||
);
|
||||
return res.data;
|
||||
@@ -1836,11 +1865,9 @@ export const deleteRepBlob = async (
|
||||
"/api/file/deleteblob?container=" +
|
||||
containerName +
|
||||
"&casefolderID=" +
|
||||
casefolderID +
|
||||
"/" +
|
||||
filenamePrefix +
|
||||
encodeURIComponent(casefolderID + "/" + filenamePrefix) +
|
||||
"&blobname=" +
|
||||
blobName +
|
||||
encodeURIComponent(blobName) +
|
||||
deleteblobhash
|
||||
);
|
||||
return res.data;
|
||||
@@ -1894,14 +1921,14 @@ export const getProgressFromBlob = async (containerName, casereference) => {
|
||||
const res = await axios.get(
|
||||
BASE_URL +
|
||||
"/api/file/getprogressobjblob?container=" +
|
||||
containerName +
|
||||
encodeURIComponent(containerName) +
|
||||
"&casefolderID=" +
|
||||
casereference +
|
||||
encodeURIComponent(casereference) +
|
||||
hashAPIPath(
|
||||
"/api/file/getprogressobjblob?container=" +
|
||||
containerName +
|
||||
encodeURIComponent(containerName) +
|
||||
"&casefolderID=" +
|
||||
casereference
|
||||
encodeURIComponent(casereference)
|
||||
)
|
||||
);
|
||||
return res.data;
|
||||
@@ -2209,3 +2236,92 @@ export const getAppealPDFDocument = async (incidentid) => {
|
||||
return error.response;
|
||||
});
|
||||
};
|
||||
export const getNewAppeals = async (searchString) => {
|
||||
try {
|
||||
const res = await axios.get(BASE_URL + "/api/admin/getnewappeals_api");
|
||||
return res.data;
|
||||
} catch (error) {
|
||||
consoleLogger(error);
|
||||
return error.response;
|
||||
}
|
||||
};
|
||||
|
||||
export const getNewAppealsPage = async (
|
||||
searchString,
|
||||
pageNumber,
|
||||
orderBy,
|
||||
fieldSort,
|
||||
showNumberOfRecords
|
||||
) => {
|
||||
return axios
|
||||
.get(
|
||||
"/api/admin/getnewappeals_api?searchString=" +
|
||||
searchString +
|
||||
"&pageNumber=" +
|
||||
pageNumber +
|
||||
"&orderby=" +
|
||||
orderBy +
|
||||
"&fieldSort=" +
|
||||
fieldSort +
|
||||
"&showNumberOfRecords=" +
|
||||
showNumberOfRecords
|
||||
)
|
||||
.then((res) => {
|
||||
return res.data;
|
||||
})
|
||||
.catch((error) => {
|
||||
consoleLogger(error);
|
||||
return error.response;
|
||||
});
|
||||
};
|
||||
|
||||
export const getNewDocumentsPaged = async (
|
||||
pageNumber,
|
||||
orderBy,
|
||||
fieldSort,
|
||||
showNumberOfRecords,
|
||||
documentType,
|
||||
documentOrigin,
|
||||
selectedWeeks
|
||||
) => {
|
||||
console.log(
|
||||
"/api/admin/getlatestdocuments_api?pageNumber=" +
|
||||
pageNumber +
|
||||
"&orderby=" +
|
||||
orderBy +
|
||||
"&fieldSort=" +
|
||||
fieldSort +
|
||||
"&showNumberOfRecords=" +
|
||||
showNumberOfRecords +
|
||||
"&documentType=" +
|
||||
documentType +
|
||||
"&numberWeeks=" +
|
||||
selectedWeeks +
|
||||
"&documentOrigin=" +
|
||||
documentOrigin
|
||||
);
|
||||
return axios
|
||||
.get(
|
||||
"/api/admin/getlatestdocuments_api?pageNumber=" +
|
||||
pageNumber +
|
||||
"&orderby=" +
|
||||
orderBy +
|
||||
"&fieldSort=" +
|
||||
fieldSort +
|
||||
"&showNumberOfRecords=" +
|
||||
showNumberOfRecords +
|
||||
"&documentType=" +
|
||||
documentType +
|
||||
"&numberWeeks=" +
|
||||
selectedWeeks +
|
||||
"&documentOrigin=" +
|
||||
documentOrigin
|
||||
)
|
||||
.then((res) => {
|
||||
return res.data;
|
||||
})
|
||||
.catch((error) => {
|
||||
consoleLogger(error);
|
||||
return error.response;
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user