Properly add game upon save

blazor
Pat Hartl 2023-03-03 18:58:05 -06:00
parent 57eb454dcc
commit 171e01cf08
1 changed files with 11 additions and 2 deletions

View File

@ -165,11 +165,20 @@
private async Task Save()
{
try
{
if (Game.Id != Guid.Empty)
{
Game = await GameService.Update(Game);
await MessageService.Success("Game updated!");
}
else
{
Game = await GameService.Add(Game);
await MessageService.Success("Game added!");
}
}
catch (Exception ex)
{
await MessageService.Error("Could not save!");