mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-06 13:57:54 +00:00
Upgrade API serialisation code to enable potential context-based serialisation
This commit is contained in:
parent
c80965394d
commit
0f22285824
7 changed files with 149 additions and 144 deletions
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue