Return TrangaSettings as proper Json instead of string

This commit is contained in:
Glax 2025-03-19 23:13:56 +01:00
parent 93ad691971
commit f2961711cf

View File

@ -1,8 +1,8 @@
using System.Text.Json.Nodes; using API.MangaDownloadClients;
using API.MangaDownloadClients;
using API.Schema; using API.Schema;
using Asp.Versioning; using Asp.Versioning;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json.Linq;
using static Microsoft.AspNetCore.Http.StatusCodes; using static Microsoft.AspNetCore.Http.StatusCodes;
namespace API.Controllers; namespace API.Controllers;
@ -17,10 +17,10 @@ public class SettingsController(PgsqlContext context) : Controller
/// </summary> /// </summary>
/// <response code="200"></response> /// <response code="200"></response>
[HttpGet] [HttpGet]
[ProducesResponseType<string>(StatusCodes.Status200OK, "application/json")] [ProducesResponseType<JObject>(Status200OK, "application/json")]
public IActionResult GetSettings() public IActionResult GetSettings()
{ {
return Ok(TrangaSettings.Serialize()); return Ok(JObject.Parse(TrangaSettings.Serialize()));
} }
/// <summary> /// <summary>