nft-faucet/NftFaucetRadzen/Components/CardList/CardListItemConfigurationDialog.razor.cs

26 lines
823 B
C#
Raw Normal View History

2022-09-15 23:11:04 -05:00
using Microsoft.AspNetCore.Components;
using Radzen;
namespace NftFaucetRadzen.Components.CardList;
2022-09-16 13:51:34 -05:00
public partial class CardListItemConfigurationDialog : BasicComponent
2022-09-15 23:11:04 -05:00
{
2022-09-16 13:51:34 -05:00
[Parameter] public Guid CardListItemId { get; set; }
[Parameter] public CardListItem CardListItem { get; set; }
2022-09-15 23:11:04 -05:00
private async Task OnSavePressed()
{
2022-09-17 20:41:56 -05:00
var result = await CardListItem.Configuration.ConfigureAction(CardListItem.Configuration.Objects);
if (result.IsFailure)
2022-09-15 23:11:04 -05:00
{
2022-09-17 20:41:56 -05:00
NotificationService.Notify(NotificationSeverity.Error, "Invalid configuration", result.Error);
2022-09-15 23:11:04 -05:00
return;
}
await CardListItem.Configuration.ConfigureAction(CardListItem.Configuration.Objects);
RefreshMediator.NotifyStateHasChangedSafe();
DialogService.Close((bool?)true);
}
}