From 124491c32c0bd09623723a9875edaefb01619e52 Mon Sep 17 00:00:00 2001 From: Wessel Tip Date: Thu, 24 Apr 2025 10:08:23 +0200 Subject: [PATCH] fix(auth): Fix available sets showing when not admin --- backend/backend/Services/GameService.cs | 4 +++ frontend/src/app/game/game.component.html | 36 ++++++++++++----------- 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/backend/backend/Services/GameService.cs b/backend/backend/Services/GameService.cs index 5c6e6f7..e299605 100644 --- a/backend/backend/Services/GameService.cs +++ b/backend/backend/Services/GameService.cs @@ -65,6 +65,10 @@ public class GameService(IGameRepository gameRepository) : IGameService { } public async Task> GetSetsInHandAsync(long gameId, long userId) { + if (userId > 0) { + return []; + } + var game = await _gameRepository.GetGameByIdAsync(gameId, userId); if (game == null) { diff --git a/frontend/src/app/game/game.component.html b/frontend/src/app/game/game.component.html index 4275489..1450d62 100755 --- a/frontend/src/app/game/game.component.html +++ b/frontend/src/app/game/game.component.html @@ -95,24 +95,26 @@
-
-

Available Sets

-
- @for(row of this.gameService.possibleSets; track row) { -
-

Set {{$index + 1}}

- @for(card of row; track card.id) { - - } -
- } + @if (gameService.possibleSets.length > 0) { +
+

Available Sets

+
+ @for(row of this.gameService.possibleSets; track row) { +
+

Set {{$index + 1}}

+ @for(card of row; track card.id) { + + } +
+ } +
-
+ }

Found Sets