Skip to content

Commit

Permalink
feat(server): refactored for better readability
Browse files Browse the repository at this point in the history
  • Loading branch information
arnolicious committed Dec 28, 2024
1 parent 78c0cad commit 13f406d
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions web/src/routes/(user)/people/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -230,12 +230,8 @@
personUpdateDto: { isFavorite: !detail.isFavorite },
});
people = people.map((person: PersonResponseDto) => {
if (person.id === updatedPerson.id) {
return updatedPerson;
}
return person;
});
const index = people.findIndex((person) => person.id === detail.id);
people[index] = updatedPerson;
notificationController.show({
message: updatedPerson.isFavorite ? $t('added_to_favorites') : $t('removed_from_favorites'),
Expand Down

0 comments on commit 13f406d

Please sign in to comment.