Skip to content

Commit

Permalink
feat: use new endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
janhenrikoverland committed Aug 28, 2024
1 parent 92b3302 commit 95232d4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"dhis": {
"href": "..",
"auth": "admin:district",
"devHref": "http://localhost:8080"
"devHref": "https://test.e2e.dhis2.org/analytics-41dev/"
}
}
}
Expand Down
16 changes: 13 additions & 3 deletions src/api/Layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -186,9 +186,19 @@ Layout.prototype.getDataTypeUrl = function() {
var OUTPUT_TYPE_EVENT = optionConfig.getOutputType('event').id;
var OUTPUT_TYPE_ENROLLMENT = optionConfig.getOutputType('enrollment').id;

var url = this.dataType === DATA_TYPE_AGG ? '/events/aggregate' :
this.outputType === OUTPUT_TYPE_EVENT ? '/events/query' :
'/enrollments/query';
var urlMap = {
[OUTPUT_TYPE_EVENT]: {
[DATA_TYPE_AGG]: '/events/aggregate',
[DATA_TYPE_EVENT]: '/events/query',
},
[OUTPUT_TYPE_ENROLLMENT]: {
[DATA_TYPE_AGG]: '/enrollments/aggregate',
[DATA_TYPE_EVENT]: '/enrollments/query',
}
}

var url = urlMap[this.outputType][this.dataType]
console.log(url)

return url || dimensionConfig.dataTypeUrl[dimensionConfig.getDefaultDataType()] || '';
};
Expand Down

0 comments on commit 95232d4

Please sign in to comment.