Upgrade API serialisation code to enable potential context-based serialisation
This commit is contained in:
@@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user