diff --git a/api/src/stores/user.ts b/api/src/stores/user.ts index abe5283..c0e06c3 100644 --- a/api/src/stores/user.ts +++ b/api/src/stores/user.ts @@ -31,7 +31,18 @@ export const useUserStore = defineStore({ getters: { users(state) { - return state._users.filter((u) => !u.deleted); + const u = state._users.filter((u) => !u.deleted); + u.sort((a, b) => { + const a_lastname = a.lastname.toLowerCase(); + const b_lastname = b.lastname.toLowerCase(); + const a_firstname = a.firstname.toLowerCase(); + const b_firstname = b.firstname.toLowerCase(); + if (a_lastname === b_lastname) { + return a_firstname < b_firstname ? -1 : 1; + } + return a_lastname < b_lastname ? -1 : 1; + }); + return u; }, },