mirror of
https://git.recroomarchive.org/RecRoomArchive/RRAC.git
synced 2026-09-08 22:51:26 -07:00
More changes...
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using RecRoomArchive.Models.API.Platform;
|
||||
using RecRoomArchive.Models.API.Players;
|
||||
using RecRoomArchive.Services;
|
||||
|
||||
namespace RecRoomArchive.Controllers.API.PlatformLogin.V1
|
||||
{
|
||||
[Route("api/[controller]/v1")]
|
||||
[ApiController]
|
||||
public class PlatformLoginController(AccountService accountService) : ControllerBase
|
||||
{
|
||||
[HttpPost(template: "profiles")]
|
||||
public async Task<ActionResult<List<BaseProfile>>> GetProfiles([FromForm(Name = "Platform")] PlatformType platform, [FromForm(Name = "PlatformId")] ulong platformId)
|
||||
{
|
||||
if (!accountService.AccountExists())
|
||||
{
|
||||
accountService.CreateAccount();
|
||||
}
|
||||
|
||||
var profile = accountService.GetSelfAccount();
|
||||
if (profile == null)
|
||||
return BadRequest("Please relaunch RRAC and re-run setup");
|
||||
|
||||
List<BaseProfile> profiles = [profile];
|
||||
|
||||
return Ok(profiles);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user