Change to using arrow functions (#1603)
* Change to using arrow functions Co-authored-by: v1b3m <vibenjamin6@gmail.com> Co-authored-by: Matheus <matheus_benini@hotmail.com> * Add lint rule --------- Co-authored-by: v1b3m <vibenjamin6@gmail.com> Co-authored-by: Matheus <matheus_benini@hotmail.com> Co-authored-by: Charles Bochet <charles@twenty.com>
This commit is contained in:
@ -1,9 +1,11 @@
|
||||
import { EntityForSelect } from '@/ui/input/relation-picker/types/EntityForSelect';
|
||||
|
||||
export function flatMapAndSortEntityForSelectArrayOfArrayByName<
|
||||
export const flatMapAndSortEntityForSelectArrayOfArrayByName = <
|
||||
T extends EntityForSelect,
|
||||
>(entityForSelectArray: T[][]) {
|
||||
>(
|
||||
entityForSelectArray: T[][],
|
||||
) => {
|
||||
const sortByName = (a: T, b: T) => a.name.localeCompare(b.name);
|
||||
|
||||
return entityForSelectArray.flatMap((entity) => entity).sort(sortByName);
|
||||
}
|
||||
};
|
||||
|
||||
@ -7,9 +7,9 @@ import {
|
||||
ActivityTargetableEntityType,
|
||||
} from '../types/ActivityTargetableEntity';
|
||||
|
||||
export function getRelationData(
|
||||
export const getRelationData = (
|
||||
entities: ActivityTargetableEntity[],
|
||||
): ActivityTargetCreateManyActivityInput[] {
|
||||
): ActivityTargetCreateManyActivityInput[] => {
|
||||
const now = new Date().toISOString();
|
||||
|
||||
const relationData: ActivityTargetCreateManyActivityInput[] = [];
|
||||
@ -40,4 +40,4 @@ export function getRelationData(
|
||||
}
|
||||
}
|
||||
return relationData;
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user