-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(#57) add option of deleting an event
- Loading branch information
Showing
4 changed files
with
53 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
33 changes: 33 additions & 0 deletions
33
MiniSpace.Web/src/MiniSpace.Web/Pages/Events/Dialogs/DeleteEventDialog.razor
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
@page "/events/{EventId}/delete" | ||
@using MiniSpace.Web.Areas.Events | ||
@using Radzen | ||
@inject DialogService DialogService | ||
@inject IEventsService EventsService | ||
@inject NavigationManager NavigationManager | ||
|
||
<RadzenStack Gap="1rem"> | ||
|
||
<RadzenStack Gap="1rem" Orientation="Orientation.Vertical" JustifyContent="JustifyContent.SpaceBetween" Style="height: 100%;"> | ||
<RadzenStack Orientation="Orientation.Horizontal" JustifyContent="JustifyContent.Center" Gap="0.5rem"> | ||
<RadzenButton Click="@(() => DeleteEvent(EventId))" Variant="Variant.Flat" Text="Delete" Style="width: 100px"/> | ||
<RadzenButton Click="@(() => DialogService.Close(true))" Variant="Variant.Flat" Text="Cancel" Style="width: 100px"/> | ||
</RadzenStack> | ||
</RadzenStack> | ||
</RadzenStack> | ||
|
||
@code { | ||
[Parameter] | ||
public Guid EventId { get; set; } | ||
|
||
protected override async Task OnInitializedAsync() | ||
{ | ||
await base.OnInitializedAsync(); | ||
} | ||
|
||
private async void DeleteEvent(Guid eventId) | ||
{ | ||
await EventsService.DeleteEventAsync(eventId); | ||
DialogService.Close(true); | ||
NavigationManager.NavigateTo("/events/organize"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters