updated cookie login and watched cases
This commit is contained in:
+22
-29
@@ -657,7 +657,7 @@ export const getLPA = (token) => {
|
||||
};
|
||||
|
||||
export const getPersonalAccount = (token, contactid) => {
|
||||
console.log("getting personal details:", contactid);
|
||||
//console.log("getting personal details:", contactid);
|
||||
return axios
|
||||
.get(
|
||||
WEBAPI_URL +
|
||||
@@ -682,7 +682,6 @@ export const getPersonalAccount = (token, contactid) => {
|
||||
};
|
||||
|
||||
export const getAppealID = (
|
||||
token,
|
||||
caseReference,
|
||||
updateFormCollection,
|
||||
primaryAttribute
|
||||
@@ -696,9 +695,9 @@ export const getAppealID = (
|
||||
caseReference +
|
||||
"'";
|
||||
|
||||
console.log("proxy url", weburl);
|
||||
console.log("proxy url ", weburl);
|
||||
return axios
|
||||
.get(weburl, azureHeaders(token))
|
||||
.get(weburl, azureHeaders(getSASToken()))
|
||||
.then((res) => {
|
||||
var appealID = res.data.value[0][primaryAttribute];
|
||||
return appealID;
|
||||
@@ -723,13 +722,14 @@ export const getLogin = (emailAddress, pwd) => {
|
||||
});
|
||||
};
|
||||
|
||||
export const createCase = (token, appealTypeId, contactid) => {
|
||||
export const createCase = (token, appealTypeId, lpaID, contactid) => {
|
||||
appealTypeId = parseInt(appealTypeId);
|
||||
var data = JSON.stringify({
|
||||
"title": "insertion test case",
|
||||
"caseorigincode": 3,
|
||||
"customerid_contact@odata.bind": "/contacts(" + contactid + ")",
|
||||
"pinswg_appealcasetype": appealTypeId,
|
||||
"pinswg_AssociatedLPA@odata.bind": "/accounts(" + lpaID + ")",
|
||||
});
|
||||
|
||||
var config = {
|
||||
@@ -757,7 +757,6 @@ export const createCase = (token, appealTypeId, contactid) => {
|
||||
};
|
||||
|
||||
export const updateCase = async (
|
||||
token,
|
||||
incidentId,
|
||||
updateBody,
|
||||
updateFormCollection,
|
||||
@@ -784,15 +783,15 @@ export const updateCase = async (
|
||||
"Accept": "application/json",
|
||||
"Prefer": 'odata.include-annotations="*",return=representation',
|
||||
"Content-Type": "application/json",
|
||||
"ServiceBusAuthorization": token,
|
||||
"ServiceBusAuthorization": getSASToken(),
|
||||
},
|
||||
data: data,
|
||||
};
|
||||
|
||||
console.log(config);
|
||||
//console.log(config);
|
||||
return axios(config)
|
||||
.then((res) => {
|
||||
console.log("patched ", res.data);
|
||||
//console.log("patched ", res.data);
|
||||
return res.data;
|
||||
})
|
||||
.catch((error) => {
|
||||
@@ -801,7 +800,7 @@ export const updateCase = async (
|
||||
};
|
||||
|
||||
export const getMyCases = (token, loggedInUserId) => {
|
||||
console.log("in action ", loggedInUserId);
|
||||
//console.log("in action ", loggedInUserId);
|
||||
return axios
|
||||
.get(
|
||||
WEBAPI_URL +
|
||||
@@ -839,24 +838,18 @@ export const getMyRepresentations = (token, loggedInUserId) => {
|
||||
};
|
||||
|
||||
export const getWatchedCases = (token, loggedInUserId) => {
|
||||
return (
|
||||
axios
|
||||
|
||||
// .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);
|
||||
})
|
||||
);
|
||||
return axios
|
||||
.get(
|
||||
WEBAPI_URL +
|
||||
"contacts(" +
|
||||
loggedInUserId +
|
||||
")/pinswg_contact_incident?$count=true&$top=3&$orderby=createdon desc",
|
||||
azureHeaders(token)
|
||||
)
|
||||
.then((res) => res.data)
|
||||
.catch((error) => {
|
||||
console.log("this serror", error);
|
||||
});
|
||||
};
|
||||
|
||||
export const getAwaitingSubmission = (token) => {
|
||||
@@ -870,7 +863,7 @@ export const getAwaitingSubmission = (token) => {
|
||||
});
|
||||
};
|
||||
|
||||
export const getPortalModuelDetails = (token, appealType, caseReference) => {
|
||||
export const getPortalModuleDetails = (token, appealType, caseReference) => {
|
||||
return axios
|
||||
.get(
|
||||
WEBAPI_URL +
|
||||
|
||||
Reference in New Issue
Block a user