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:
parent
650f2c58d3
commit
4aa4a0add5
@ -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
|
||||
{
|
||||
|
||||
@ -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>());
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user