mirror of
https://github.com/Paris-est-Ludique/intranet.git
synced 2025-09-11 22:06:29 +02:00
sort volunteers alphabetically in team assign
This commit is contained in:
@@ -60,3 +60,9 @@ export const selectVolunteerList = createSelector(
|
||||
return ids.map((id) => entities[id]) as Volunteer[]
|
||||
}
|
||||
)
|
||||
|
||||
const fullName = (volunteer: Volunteer) => `${volunteer.firstname} ${volunteer.lastname}`
|
||||
|
||||
export const selectVolunteerListAlphaSorted = createSelector(selectVolunteerList, (volunteer) =>
|
||||
[...volunteer].sort((vA, vB) => fullName(vA).localeCompare(fullName(vB)))
|
||||
)
|
||||
|
Reference in New Issue
Block a user