From d32ff56da81b3ca1008579f5df40bb5a77282e97 Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Sun, 6 Jul 2025 07:36:14 +0300 Subject: [PATCH] Fix can add players without friend code --- app/features/tournament/actions/to.$id.register.server.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/features/tournament/actions/to.$id.register.server.ts b/app/features/tournament/actions/to.$id.register.server.ts index fcccbc98e..eb8e45a1b 100644 --- a/app/features/tournament/actions/to.$id.register.server.ts +++ b/app/features/tournament/actions/to.$id.register.server.ts @@ -261,8 +261,8 @@ export const action: ActionFunction = async ({ request, params }) => { "No trust given from this user", ); errorToastIfFalsy( - (await UserRepository.findLeanById(user.id))?.friendCode, - "No friend code", + (await UserRepository.findLeanById(data.userId))?.friendCode, + "User you are trying to add has no friend code set", ); errorToastIfFalsy(tournament.registrationOpen, "Registration is closed");