306 implement multi relation picker for person and try to factorize relation picker (#319)
* Removed useless folder * First working version * Refactored MultipleEntitySelect and splitted into 2 components * Added TODO * Removed useless Query * Fixed refetch * Fixed naming * Fix tests --------- Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
@ -0,0 +1,10 @@
|
||||
import { EntityForSelect } from '@/comments/components/MultipleEntitySelect';
|
||||
|
||||
export function flatMapAndSortEntityForSelectArrayOfArrayByName(
|
||||
entityForSelectArray: EntityForSelect[][],
|
||||
) {
|
||||
const sortByName = (a: EntityForSelect, b: EntityForSelect) =>
|
||||
a.name.localeCompare(b.name);
|
||||
|
||||
return entityForSelectArray.flatMap((entity) => entity).sort(sortByName);
|
||||
}
|
||||
Reference in New Issue
Block a user