Implemented handling of server side issues using the rfc for problem detasils in the frontend

This commit is contained in:
2026-01-29 09:28:50 +01:00
parent 136620f1e6
commit 97a676ccd7
14 changed files with 212 additions and 82 deletions

View File

@@ -3,6 +3,7 @@
@using Microsoft.AspNetCore.Authorization
@using Moonlight.Shared
@using LucideBlazor
@using Moonlight.Frontend.Helpers
@using Moonlight.Frontend.Services
@using Moonlight.Shared.Http.Requests.Themes
@using ShadcnBlazor.Buttons
@@ -118,11 +119,17 @@
{
Request.CssContent = await Editor.GetValueAsync();
await HttpClient.PostAsJsonAsync(
var response = await HttpClient.PostAsJsonAsync(
"/api/admin/themes",
Request,
Constants.SerializerOptions
);
if (!response.IsSuccessStatusCode)
{
await ProblemDetailsHelper.HandleProblemDetailsAsync(response, Request, validationMessageStore);
return false;
}
await ToastService.SuccessAsync(
"Theme creation",