Upgrade API serialisation code to enable potential context-based serialisation

This commit is contained in:
Ske
2019-12-28 15:52:59 +01:00
parent c80965394d
commit 0f22285824
7 changed files with 149 additions and 144 deletions

View File

@@ -1,6 +1,8 @@
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;
using Newtonsoft.Json.Linq;
namespace PluralKit.API.Controllers
{
[ApiController]
@@ -16,12 +18,12 @@ namespace PluralKit.API.Controllers
}
[HttpGet("{aid}")]
public async Task<ActionResult<PKSystem>> GetSystemByAccount(ulong aid)
public async Task<ActionResult<JObject>> GetSystemByAccount(ulong aid)
{
var system = await _data.GetSystemByAccount(aid);
if (system == null) return NotFound("Account not found.");
return Ok(system);
return Ok(system.ToJson());
}
}
}