feat: DeleteAsync-Methode hinzufügen und Methodennamen mit 'Async'-Suffix refaktorisieren

- Hinzugefügt: DeleteAsync-Methode zur Handhabung der Dokumentenlöschung.
- Bestehende Methoden umbenannt, um 'Async'-Suffix für Konsistenz zu enthalten.
This commit is contained in:
Developer 02 2024-09-13 13:46:17 +02:00
parent 650f2c58d3
commit 4aa4a0add5
2 changed files with 7 additions and 5 deletions

View File

@ -1,6 +1,4 @@
using Newtonsoft.Json;
namespace WindreamHub.Legacy.Client.Models.Documents.Request.Delete
namespace WindreamHub.Legacy.Client.Models.Documents.Request.Delete
{
public class DocDeleteBody
{

View File

@ -10,6 +10,8 @@ using System.IO;
using System.Web;
using WindreamHub.Legacy.Client.Models.Documents;
using System.Linq;
using WindreamHub.Legacy.Client.Models.Documents.Response.Delete;
using WindreamHub.Legacy.Client.Models.Documents.Request.Delete;
namespace WindreamHub.Legacy.Client.Routes
{
@ -83,9 +85,11 @@ namespace WindreamHub.Legacy.Client.Routes
if (stream_identity != null)
query["parameter.stream.__identity"] = stream_identity.ToString();
return await FetchAsync(route: $"/Download?{query}", method: HttpMethod.Get).ThenAsync(res => res.Simplify<DocResponse, DocResponse>());
}
public async Task<SimplifiedResponse<DocResponse, DocDelErrorResponse>> DeleteAsync(DocDeleteBody docDeleteBody)
=> await FetchAsync(route: "/Delete", HttpMethod.Post, body: docDeleteBody.Stringify())
.ThenAsync(res => res.Simplify<DocResponse, DocDelErrorResponse>());
}
}