Workshop - Added image uploading

This commit is contained in:
Robert committed 2023-11-09 23:34:35 +01:00
1 parent 0667d58ed8
commit e33ae8a066
9 files changed
+120 -35

No files matched your search

@@ -185,7 +185,7 @@ internal class AuthenticationService : CorePropertyChanged, IAuthenticationServi
return;
// Start a HTTP listener, this port could be in use but chances are very slim
string redirectUri = "http://localhost:56789";
string redirectUri = "http://localhost:57461";
using HttpListener listener = new();
listener.Prefixes.Add(redirectUri + "/");
listener.Start();
@@ -69,7 +69,10 @@ public class WorkshopService : IWorkshopService
ProgressableStreamContent streamContent = new(request.File, progress);
streamContent.Headers.ContentType = new MediaTypeHeaderValue("image/png");
content.Add(streamContent, "file", "file.png");
content.Add(new StringContent(request.Name), "Name");
if (request.Description != null)
content.Add(new StringContent(request.Description), "Description");
// Submit
HttpResponseMessage response = await client.PostAsync($"entries/{entryId}/image", content, cancellationToken);
if (!response.IsSuccessStatusCode)