mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 13:06:50 +00:00
Refactor data stores, merging the Store classes
This commit is contained in:
parent
1ab84b54dd
commit
6a73b3bdd6
21 changed files with 540 additions and 338 deletions
|
|
@ -8,17 +8,17 @@ namespace PluralKit.API.Controllers
|
|||
[Route("v1/a")]
|
||||
public class AccountController: ControllerBase
|
||||
{
|
||||
private SystemStore _systems;
|
||||
private IDataStore _data;
|
||||
|
||||
public AccountController(SystemStore systems)
|
||||
public AccountController(IDataStore data)
|
||||
{
|
||||
_systems = systems;
|
||||
_data = data;
|
||||
}
|
||||
|
||||
[HttpGet("{aid}")]
|
||||
public async Task<ActionResult<PKSystem>> GetSystemByAccount(ulong aid)
|
||||
{
|
||||
var system = await _systems.GetByAccount(aid);
|
||||
var system = await _data.GetSystemByAccount(aid);
|
||||
if (system == null) return NotFound("Account not found.");
|
||||
|
||||
return Ok(system);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue