Skip to content

Commit b93a73f

Browse files
committed
avniproject/avni-webapp#1242 | Use global axios headers only in servicing DEA calls routed through avni-server
1 parent d2b950f commit b93a73f

File tree

4 files changed

+11
-11
lines changed

4 files changed

+11
-11
lines changed

package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"safe-eval": "^0.4.1",
1212
"uuid": "^7.0.2",
1313
"avni-health-modules": "0.0.26",
14-
"openchs-models": "1.31.48",
14+
"openchs-models": "1.31.76",
1515
"rules-config": "https://github.com/avniproject/rules-config.git#fe552da405368bfd138e2f38e605c1d307e3ebe4",
1616
"lodash": "^4.17.11",
1717
"moment": "^2.22.2"

src/services/AuthService.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export const setUploadUser = async () => {
1212
console.debug("Fetched details ", details);
1313
cognitoDetails.setDetails(details);
1414
}
15-
if (!cognitoDetails.isDummy()) {
15+
if (!(cognitoDetails.isDummy() || cognitoDetails.isEmpty())) {
1616
console.debug("Setting up upload user");
1717
await setupUploadUser();
1818
}
@@ -37,7 +37,7 @@ const signIn = async function () {
3737
};
3838

3939
export const getUploadUserToken = async () => {
40-
if (cognitoDetails.isDummy()) return null;
40+
if (cognitoDetails.isDummy() || cognitoDetails.isEmpty()) return null;
4141
console.debug("Getting upload user token");
4242
const currentSession = await Auth.currentSession();
4343
const jwtToken = currentSession.idToken.jwtToken;

src/services/api.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ const BASE_URL = "http://localhost:8021";
66
export default {
77
getLegacyRulesBundle: (token) =>
88
axios
9-
.get(BASE_URL + "/ruleDependency/search/lastModified?lastModifiedDateTime=1900-01-01T00:00:00.000Z&size=1000", putTokenHeader(token))
9+
.get(BASE_URL + "/ruleDependency/search/lastModified?lastModifiedDateTime=1900-01-01T00:00:00.000Z&size=1000", token && putTokenHeader(token))
1010
.then(response => get(response, "data._embedded.ruleDependency[0].code")),
1111
getLegacyRules: (token) =>
1212
axios
13-
.get(BASE_URL + "/rule/search/lastModified?lastModifiedDateTime=1900-01-01T00:00:00.000Z&size=1000", putTokenHeader(token))
13+
.get(BASE_URL + "/rule/search/lastModified?lastModifiedDateTime=1900-01-01T00:00:00.000Z&size=1000", token && putTokenHeader(token))
1414
.then(response => get(response, "data._embedded.rule")),
1515
getSubjects: (addressLevelUUID, subjectTypeName) =>
1616
axios

0 commit comments

Comments
 (0)