From 171e01cf08aa45c49e59acef957cb0fb6355f2d5 Mon Sep 17 00:00:00 2001 From: Pat Hartl Date: Fri, 3 Mar 2023 18:58:05 -0600 Subject: [PATCH] Properly add game upon save --- LANCommander/Pages/Games/Edit.razor | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/LANCommander/Pages/Games/Edit.razor b/LANCommander/Pages/Games/Edit.razor index ff3b910..83abdad 100644 --- a/LANCommander/Pages/Games/Edit.razor +++ b/LANCommander/Pages/Games/Edit.razor @@ -166,9 +166,18 @@ { try { - Game = await GameService.Update(Game); + if (Game.Id != Guid.Empty) + { + Game = await GameService.Update(Game); - await MessageService.Success("Game updated!"); + await MessageService.Success("Game updated!"); + } + else + { + Game = await GameService.Add(Game); + + await MessageService.Success("Game added!"); + } } catch (Exception ex) {