Skip to content

Commit

Permalink
feat(users): sorts users by firstname + lastname
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasRichel committed Apr 16, 2021
1 parent c5e4884 commit 94d70da
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/state/projects.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ const loadProjectUsers = async project => {
...user,
isSelf: user.id === currentUser.value.id
}));
users = users
.slice()
.sort((a, b) =>
`${a.firstname}${a.lastname}` < `${b.firstname}${b.lastname}` ? -1 : 1
);
state.currentProjectUsers = users;
return users;
};
Expand Down
5 changes: 5 additions & 0 deletions src/state/spaces.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ const loadSpaceUsers = async space => {
...user,
isSelf: user.id === currentUser.value.id
}));
users = users
.slice()
.sort((a, b) =>
`${a.firstname}${a.lastname}` < `${b.firstname}${b.lastname}` ? -1 : 1
);
state.currentSpaceUsers = users;
return users;
};
Expand Down

0 comments on commit 94d70da

Please sign in to comment.