From 8ae9e698edd9caa1d478920a5601daaeff04f54c Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Tue, 4 Mar 2025 22:26:55 +0200 Subject: [PATCH] Fix selected organization not always shown when editing tournament --- app/features/calendar/loaders/calendar.new.server.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/features/calendar/loaders/calendar.new.server.ts b/app/features/calendar/loaders/calendar.new.server.ts index 2282a4bfd..7f755241b 100644 --- a/app/features/calendar/loaders/calendar.new.server.ts +++ b/app/features/calendar/loaders/calendar.new.server.ts @@ -84,8 +84,12 @@ export const loader = async ({ request }: LoaderFunctionArgs) => { user.isTournamentOrganizer && !eventToEdit ? await CalendarRepository.findRecentTournamentsByAuthorId(user.id) : undefined, - organizations: await TournamentOrganizationRepository.findByOrganizerUserId( - user.id, + organizations: ( + await TournamentOrganizationRepository.findByOrganizerUserId(user.id) + ).concat( + eventToEdit?.tournament?.ctx.organization + ? eventToEdit.tournament.ctx.organization + : [], ), }; };