From 55a53c51a903e91fc6c6da5622b1e2d5c50daae6 Mon Sep 17 00:00:00 2001 From: Nabil Adouani Date: Fri, 22 May 2020 14:07:54 +0200 Subject: [PATCH] #1327 Update UserSrv for a better configuration --- .../components/organisation/OrgCaseTemplateListCmp.js | 4 ++-- frontend/app/scripts/directives/updatableUser.js | 2 +- frontend/app/scripts/services/api/UserSrv.js | 10 ++++++---- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/frontend/app/scripts/components/organisation/OrgCaseTemplateListCmp.js b/frontend/app/scripts/components/organisation/OrgCaseTemplateListCmp.js index 821189ce11..6403ed5f67 100644 --- a/frontend/app/scripts/components/organisation/OrgCaseTemplateListCmp.js +++ b/frontend/app/scripts/components/organisation/OrgCaseTemplateListCmp.js @@ -178,9 +178,9 @@ return UserSrv.list( self.currentUser.organisation, { - filter: {_is: { locked: false }}, + filter: { locked: false }, sort: [{'name': 'asc'}] - } + } ); }, groups: function() { diff --git a/frontend/app/scripts/directives/updatableUser.js b/frontend/app/scripts/directives/updatableUser.js index dcf2c98e20..f24f94af8d 100644 --- a/frontend/app/scripts/directives/updatableUser.js +++ b/frontend/app/scripts/directives/updatableUser.js @@ -18,7 +18,7 @@ if(value === true && !cached) { UserSrv.list(AuthenticationSrv.currentUser.organisation, { - filter: {_is: { locked: false }}, + filter: { locked: false }, sort: [{'name': 'asc'}] }) .then(function(users) { diff --git a/frontend/app/scripts/services/api/UserSrv.js b/frontend/app/scripts/services/api/UserSrv.js index d8ef2c19ee..9ff7cc820b 100644 --- a/frontend/app/scripts/services/api/UserSrv.js +++ b/frontend/app/scripts/services/api/UserSrv.js @@ -184,13 +184,15 @@ } ]; + // Apply filter is defined if (options && options.filter) { - options.filter._name = 'filter'; - - operations.push(options.filter); + operations.push({ + '_name': 'filter', + '_is': options.filter + }); } - // Sort users by name + // Apply sort is defined if (options && options.sort) { operations.push({ '_name': 'sort',