From d2d540927ae6bc5679f28df576bb579e73e75083 Mon Sep 17 00:00:00 2001 From: JohHub Date: Fri, 7 Oct 2022 20:19:46 +0200 Subject: [PATCH] add button to leave wse, implements frontend part of #158 --- Frontend/Pages/WSE/WseDetail.razor | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Frontend/Pages/WSE/WseDetail.razor b/Frontend/Pages/WSE/WseDetail.razor index f50b928..583ff0f 100644 --- a/Frontend/Pages/WSE/WseDetail.razor +++ b/Frontend/Pages/WSE/WseDetail.razor @@ -54,7 +54,7 @@
- @_contactPerson!.FirstNames @_contactPerson.LastName + @_contactPerson!.FirstNames @_contactPerson.LastName
Aufrufzahl: @_wse.ViewCount @@ -248,6 +248,9 @@ @if (_isCollab) { @if (!_displayEditForm) {
+ @@ -425,4 +428,13 @@ NavManager.NavigateTo("wse/" + WseId); } + private async Task Leave() { + var response = await HttpClient.PostAsync($"wse/{WseId}/leave", null); + if (response.IsSuccessStatusCode) { + NavManager.NavigateTo(""); + } else { + _conflictMessage = await response.Content.ReadAsStringAsync(); + } + } + }