Added base supplement functionality.

This commit is contained in:
Patrick Fic
2020-02-12 15:56:09 -08:00
parent 7e61bffce5
commit 5b873146b8
10 changed files with 64 additions and 23 deletions

View File

@@ -25,8 +25,6 @@ const errorLink = onError(
}
if (expired) {
//User access token has expired
//props.history.push("/network-error");
console.log("We need a new token!");
console.log("Old Token", window.localStorage.getItem("token"));
// Let's refresh token through async request
@@ -35,15 +33,15 @@ const errorLink = onError(
console.log("Got the new token.", token);
window.localStorage.setItem("token", token);
const oldHeaders = operation.getContext().headers;
operation.setContext({
headers: {
...oldHeaders,
authorization: token ? `Bearer ${token}` : ""
}
});
console.log("forward", forward);
console.log("operation", operation);
// const oldHeaders = operation.getContext().headers;
// operation.setContext({
// headers: {
// ...oldHeaders,
// authorization: token ? `Bearer ${token}` : ""
// }
// });
// console.log("forward", forward);
// console.log("operation", operation);
return forward(operation).subscribe();
// return new Observable(observer => {

View File

@@ -120,6 +120,7 @@ export const GET_JOB_BY_PK = gql`
ins_co_id
policy_no
loss_date
clm_no
area_of_damage
ins_co_nm
ins_addr1