From f99350a3293d5eb6b4ff98b94c4877a9c71ada55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miskolczi=20Rich=C3=A1rd?= Date: Mon, 29 Apr 2024 22:58:18 +0200 Subject: [PATCH] Fixed an issue where the associated CRUD action of PUT and POST were switched up --- WD7UVN_SzTGUI_2023242.Client.WPF/RestCollection.cs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/WD7UVN_SzTGUI_2023242.Client.WPF/RestCollection.cs b/WD7UVN_SzTGUI_2023242.Client.WPF/RestCollection.cs index ca62261..813132c 100644 --- a/WD7UVN_SzTGUI_2023242.Client.WPF/RestCollection.cs +++ b/WD7UVN_SzTGUI_2023242.Client.WPF/RestCollection.cs @@ -157,7 +157,7 @@ namespace WD7UVN_SzTGUI_2023242.Client.WPF public async Task PostAsync(T item, string endpoint) { HttpResponseMessage response = - await client.PostAsJsonAsync(endpoint, item); + await client.PostAsJsonAsync("api/" + endpoint, item); if (!response.IsSuccessStatusCode) { @@ -211,7 +211,7 @@ namespace WD7UVN_SzTGUI_2023242.Client.WPF public async Task PutAsync(T item, string endpoint) { HttpResponseMessage response = - await client.PutAsJsonAsync(endpoint, item); + await client.PutAsJsonAsync("api/" + endpoint, item); if (!response.IsSuccessStatusCode) { @@ -357,11 +357,11 @@ namespace WD7UVN_SzTGUI_2023242.Client.WPF { if (hasSignalR) { - this.rest.PostAsync(item, typeof(T).Name); + this.rest.PutAsync(item, typeof(T).Name); } else { - this.rest.PostAsync(item, typeof(T).Name).ContinueWith((t) => + this.rest.PutAsync(item, typeof(T).Name).ContinueWith((t) => { Init().ContinueWith(z => { @@ -379,11 +379,11 @@ namespace WD7UVN_SzTGUI_2023242.Client.WPF { if (hasSignalR) { - this.rest.PutAsync(item, typeof(T).Name); + this.rest.PostAsync(item, typeof(T).Name); } else { - this.rest.PutAsync(item, typeof(T).Name).ContinueWith((t) => + this.rest.PostAsync(item, typeof(T).Name).ContinueWith((t) => { Init().ContinueWith(z => {