Push alert when there is an error deleting a game
parent
ab67092c2f
commit
d0d6701380
|
@ -7,6 +7,7 @@
|
||||||
@attribute [Authorize]
|
@attribute [Authorize]
|
||||||
@inject GameService GameService
|
@inject GameService GameService
|
||||||
@inject NavigationManager NavigationManager
|
@inject NavigationManager NavigationManager
|
||||||
|
@inject IMessageService MessageService
|
||||||
|
|
||||||
<PageHeader Title="Games">
|
<PageHeader Title="Games">
|
||||||
<PageHeaderExtra>
|
<PageHeaderExtra>
|
||||||
|
@ -174,7 +175,14 @@
|
||||||
|
|
||||||
Loading = true;
|
Loading = true;
|
||||||
|
|
||||||
await GameService.Delete(game);
|
try
|
||||||
|
{
|
||||||
|
await GameService.Delete(game);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageService.Error("Could not delete the game!");
|
||||||
|
}
|
||||||
|
|
||||||
Games = await GameService.Get(x => true).OrderBy(g => String.IsNullOrWhiteSpace(g.SortTitle) ? g.Title : g.SortTitle).ToListAsync();
|
Games = await GameService.Get(x => true).OrderBy(g => String.IsNullOrWhiteSpace(g.SortTitle) ? g.Title : g.SortTitle).ToListAsync();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue