Skip to content

Commit

Permalink
LF-4165 Move getSexMap function outside forEach in formatDBAnimalsToS…
Browse files Browse the repository at this point in the history
…ummary
  • Loading branch information
SayakaOno committed Aug 29, 2024
1 parent 26df86f commit 02ab0ba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/webapp/src/containers/Animals/AddAnimals/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ interface Config {
export const formatDBAnimalsToSummary = (data: Animal[], config: Config): AnimalSummary[] => {
const animalsPerTypeAndBreed = {} as { [key: string]: AnimalSummary };
const { defaultTypes, customTypes, defaultBreeds, customBreeds, sexes } = config;
const sexMap = getSexMap(sexes, true);

data.forEach((animal) => {
const typeBreedkey = getTypeBreedKey(animal);
const sexMap = getSexMap(sexes, true);

if (!animalsPerTypeAndBreed[typeBreedkey]) {
const typeString = chooseAnimalTypeLabel(animal, defaultTypes, customTypes);
Expand Down

0 comments on commit 02ab0ba

Please sign in to comment.