diff --git a/src/app/components/mnoe-organizations-list/mnoe-organizations-list.coffee b/src/app/components/mnoe-organizations-list/mnoe-organizations-list.coffee index 82444f2e..3ff2ee14 100644 --- a/src/app/components/mnoe-organizations-list/mnoe-organizations-list.coffee +++ b/src/app/components/mnoe-organizations-list/mnoe-organizations-list.coffee @@ -14,7 +14,7 @@ # Variables initialization scope.organizations = search: '' - sortAttr: 'created_at' + sortAttr: 'created_at.desc' nbItems: 10 page: 1 pageChangedCb: (nbItems, page) -> @@ -80,6 +80,7 @@ # Smart table callback scope.pipe = (tableState) -> # The order has changed - reset pagination + debugger scope.organizations.page = 1 scope.organizations.sortAttr = tableState.sort.predicate if tableState.sort.reverse @@ -87,7 +88,7 @@ fetchOrganizations(scope.organizations.nbItems, 0, scope.organizations.sortAttr) # Fetch organisations - fetchOrganizations = (limit, offset, sort = 'created_at') -> + fetchOrganizations = (limit, offset, sort = 'created_at.desc') -> scope.organizations.loading = true MnoeCurrentUser.getUser().then( -> params = if MnoeAdminConfig.isAccountManagerEnabled() diff --git a/src/app/components/mnoe-users-list/mno-users-list.coffee b/src/app/components/mnoe-users-list/mno-users-list.coffee index a84c9995..3be089d1 100644 --- a/src/app/components/mnoe-users-list/mno-users-list.coffee +++ b/src/app/components/mnoe-users-list/mno-users-list.coffee @@ -11,7 +11,7 @@ # Variables initialization scope.users = search: '' - sortAttr: 'created_at' + sortAttr: 'created_at.desc' nbItems: 10 page: 1 pageChangedCb: (nbItems, page) -> @@ -79,7 +79,7 @@ fetchUsers(scope.users.nbItems, 0, scope.users.sortAttr) # Fetch users - fetchUsers = (limit, offset, sort = 'surname') -> + fetchUsers = (limit, offset, sort = 'created_at.desc') -> scope.users.loading = true MnoeCurrentUser.getUser().then( -> params = if MnoeAdminConfig.isAccountManagerEnabled()