Skip to content

Commit

Permalink
avniproject/avni-webapp#1242 | Use global axios headers only in servi…
Browse files Browse the repository at this point in the history
…cing DEA calls routed through avni-server
  • Loading branch information
himeshr committed Jun 10, 2024
1 parent d2b950f commit b93a73f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"safe-eval": "^0.4.1",
"uuid": "^7.0.2",
"avni-health-modules": "0.0.26",
"openchs-models": "1.31.48",
"openchs-models": "1.31.76",
"rules-config": "https://github.com/avniproject/rules-config.git#fe552da405368bfd138e2f38e605c1d307e3ebe4",
"lodash": "^4.17.11",
"moment": "^2.22.2"
Expand Down
4 changes: 2 additions & 2 deletions src/services/AuthService.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const setUploadUser = async () => {
console.debug("Fetched details ", details);
cognitoDetails.setDetails(details);
}
if (!cognitoDetails.isDummy()) {
if (!(cognitoDetails.isDummy() || cognitoDetails.isEmpty())) {
console.debug("Setting up upload user");
await setupUploadUser();
}
Expand All @@ -37,7 +37,7 @@ const signIn = async function () {
};

export const getUploadUserToken = async () => {
if (cognitoDetails.isDummy()) return null;
if (cognitoDetails.isDummy() || cognitoDetails.isEmpty()) return null;
console.debug("Getting upload user token");
const currentSession = await Auth.currentSession();
const jwtToken = currentSession.idToken.jwtToken;
Expand Down
4 changes: 2 additions & 2 deletions src/services/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ const BASE_URL = "http://localhost:8021";
export default {
getLegacyRulesBundle: (token) =>
axios
.get(BASE_URL + "/ruleDependency/search/lastModified?lastModifiedDateTime=1900-01-01T00:00:00.000Z&size=1000", putTokenHeader(token))
.get(BASE_URL + "/ruleDependency/search/lastModified?lastModifiedDateTime=1900-01-01T00:00:00.000Z&size=1000", token && putTokenHeader(token))
.then(response => get(response, "data._embedded.ruleDependency[0].code")),
getLegacyRules: (token) =>
axios
.get(BASE_URL + "/rule/search/lastModified?lastModifiedDateTime=1900-01-01T00:00:00.000Z&size=1000", putTokenHeader(token))
.get(BASE_URL + "/rule/search/lastModified?lastModifiedDateTime=1900-01-01T00:00:00.000Z&size=1000", token && putTokenHeader(token))
.then(response => get(response, "data._embedded.rule")),
getSubjects: (addressLevelUUID, subjectTypeName) =>
axios
Expand Down

0 comments on commit b93a73f

Please sign in to comment.