Skip to content

Commit

Permalink
Merge pull request #462 from EyeSeeTea/development
Browse files Browse the repository at this point in the history
Release 2.6.4
  • Loading branch information
adrianq authored Oct 2, 2024
2 parents bcb749a + d1856ae commit bf3de46
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "d2-dataset-configuration",
"version": "2.6.3",
"version": "2.6.4",
"description": "Dataset Configuration User Interface",
"main": "src/index.html",
"scripts": {
Expand Down
7 changes: 4 additions & 3 deletions src/models/DataSetStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,9 +170,10 @@ class Factory {
}

getUserRolesForCurrentUser() {
// Dhis2 has d2.currentUser.getUserRoles(), but the call generates a wrong URL and fails.
return this.d2.models.users
.get(this.d2.currentUser.id, { fields: "userCredentials[userRoles[id,name]]" })
// d2.currentUser.getUserRoles generates an invalid URL. Use directly endpoint /api/me instead.
const api = d2.Api.getApi();
return api
.get("/me", { fields: "userCredentials[userRoles[id,name]]" })
.then(user => user.userCredentials.userRoles);
}

Expand Down

0 comments on commit bf3de46

Please sign in to comment.