From e1653c9d9e0dd0c98bfeadff47f18dea5f5bb542 Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Sat, 8 Feb 2025 12:53:32 +0200 Subject: [PATCH] Fix managers can't upload team pics --- app/features/img-upload/routes/upload.tsx | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/app/features/img-upload/routes/upload.tsx b/app/features/img-upload/routes/upload.tsx index c59f68af3..13d4b5dbb 100644 --- a/app/features/img-upload/routes/upload.tsx +++ b/app/features/img-upload/routes/upload.tsx @@ -28,16 +28,8 @@ export const loader = async ({ request }: LoaderFunctionArgs) => { if (validatedType === "team-pfp" || validatedType === "team-banner") { const teamCustomUrl = new URL(request.url).searchParams.get("team") ?? ""; const team = await TeamRepository.findByCustomUrl(teamCustomUrl); - if ( - !team || - !team.members.some((member) => member.id === user.id && member.isOwner) - ) { - throw redirect("/"); - } - const detailedTeam = await TeamRepository.findByCustomUrl(team.customUrl); - - if (!detailedTeam || !isTeamManager({ team: detailedTeam, user })) { + if (!team || !isTeamManager({ team, user })) { throw redirect("/"); } }