Refactor AppUserInfo

This commit is contained in:
Dennis Reimann 2024-04-09 20:45:21 +02:00
parent 03b68b12e5
commit 395abe0e5c
No known key found for this signature in database
GPG key ID: 5009E1797F03F8D0
2 changed files with 4 additions and 3 deletions

View file

@ -1,7 +1,8 @@
using System.Collections.Generic;
namespace BTCPayApp.CommonServer;
public class AppUserInfoResponse
public class AppUserInfo
{
public string UserId { get; set; }
public string Email { get; set; }

View file

@ -123,13 +123,13 @@ public class BtcPayAppController(
}
[HttpGet("info")]
public async Task<Results<Ok<AppUserInfoResponse>, ValidationProblem, NotFound>> Info()
public async Task<Results<Ok<AppUserInfo>, ValidationProblem, NotFound>> Info()
{
var user = await userManager.GetUserAsync(User);
if (user == null) return TypedResults.NotFound();
var userStores = await storeRepository.GetStoresByUserId(user.Id);
return TypedResults.Ok(new AppUserInfoResponse
return TypedResults.Ok(new AppUserInfo
{
UserId = user.Id,
Email = await userManager.GetEmailAsync(user),