added watched cases and remove watched cases

This commit is contained in:
2021-11-04 12:36:06 +00:00
parent fa4c765799
commit 3566da1989
23 changed files with 608 additions and 162 deletions
+89 -4
View File
@@ -841,9 +841,9 @@ export const getWatchedCases = (token, loggedInUserId) => {
return axios
.get(
WEBAPI_URL +
"contacts(" +
"pinswg_watchlists?$filter= _pinswg_contact_value eq " +
loggedInUserId +
")/pinswg_contact_incident?$count=true&$top=3&$orderby=createdon desc",
"&$count=true&$orderby=createdon desc",
azureHeaders(token)
)
.then((res) => res.data)
@@ -852,6 +852,71 @@ export const getWatchedCases = (token, loggedInUserId) => {
});
};
export const getWatchedCasesProxy = (token, loggedInUserId) => {
return axios
.get(
"/api/proxy/pinswg_watchlists?$filter= _pinswg_contact_value eq " +
loggedInUserId +
"&$count=true&$orderby=createdon desc",
azureHeaders(token)
)
.then((res) => res.data)
.catch((error) => {
console.log("this serror", error);
});
};
export const createWatchedCases = (formValues) => {
var data = JSON.stringify(formValues);
var config = {
method: "post",
url: "/api/proxy/pinswg_watchlists",
headers: {
"OData-MaxVersion": "4.0",
"OData-Version": "4.0",
"Accept": "application/json",
"Prefer": 'odata.include-annotations="*",return=representation',
"Content-Type": "application/json",
"ServiceBusAuthorization": getSASToken(),
},
data: data,
};
// console.log(config);
return axios(config)
.then((res) => {
//console.log("posted ", res.data);
return res.data;
})
.catch((error) => {
console.log("this serror", error);
});
};
export const deleteWatchedCases = (watchedCaseID) => {
var config = {
method: "delete",
url: "/api/proxy/pinswg_watchlists(" + watchedCaseID + ")",
headers: {
"OData-MaxVersion": "4.0",
"OData-Version": "4.0",
"Accept": "application/json",
"Prefer": 'odata.include-annotations="*",return=representation',
"Content-Type": "application/json",
"ServiceBusAuthorization": getSASToken(),
},
};
// console.log(config);
return axios(config)
.then((res) => {
//console.log("deleted ", res.data);
return res.data;
})
.catch((error) => {
console.log("this serror", error);
});
};
export const getAwaitingSubmission = (token) => {
return axios
.get(BASE_URL + "/api/lookups/awaitingSubmission", {
@@ -879,6 +944,26 @@ export const getPortalModuleDetails = (token, appealType, caseReference) => {
});
};
export const getPortalModuleDetailsProxy = (
token,
appealType,
caseReference
) => {
return axios
.get(
"/api/proxy/" +
appealType +
"?$filter=pinswg_name eq '" +
caseReference +
"'&$count=true",
azureHeaders(token)
)
.then((res) => res.data)
.catch((error) => {
console.log("thiserror", error);
});
};
export const getEmailAccountCheck = (emailAddress) => {
let token = getSASToken();
return axios
@@ -939,7 +1024,7 @@ export const updateAccount = (contactId, updateBody) => {
// console.log(config);
return axios(config)
.then((res) => {
console.log("posted ", res.data);
//console.log("posted ", res.data);
return res.data;
})
.catch((error) => {
@@ -967,7 +1052,7 @@ export const updatePassword = (contactId, newpassword) => {
// console.log(config);
return axios(config)
.then((res) => {
console.log("posted ", res.data);
//console.log("posted ", res.data);
return res.data;
})
.catch((error) => {