watched case and stop wathcing case added

This commit is contained in:
2021-11-04 12:03:01 +00:00
parent 3283b92138
commit 449b089aba
23 changed files with 675 additions and 179 deletions
+98 -19
View File
@@ -838,24 +838,83 @@ export const getMyRepresentations = (token, loggedInUserId) => {
};
export const getWatchedCases = (token, loggedInUserId) => {
return (
axios
return axios
.get(
WEBAPI_URL +
"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);
});
};
// .get(BASE_URL + "/api/lookups/watchedCases", {
// httpsAgent: new https.Agent({ rejectUnauthorized: false }),
// })
.get(
WEBAPI_URL +
"incidents?$select=ticketnumber,casetypecode,createdon,_customerid_value,description,incidentid,pinswg_appealcasetype,_pinswg_assignedinspectrids_value,statecode,statuscode,title&$filter=_customerid_value eq " +
loggedInUserId +
" and pinswg_appealcasetype ne null&$orderby=createdon desc&$count=true&$top=3",
azureHeaders(token)
)
.then((res) => res.data)
.catch((error) => {
console.log("this serror", error);
})
);
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) => {
@@ -885,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
@@ -945,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) => {
@@ -973,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) => {