Implemented handling of server side issues using the rfc for problem detasils in the frontend
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user