mirror of
https://github.com/btcpayserver/btcpayserver.git
synced 2025-02-24 06:47:50 +01:00
Refactor AppUserInfo
This commit is contained in:
parent
03b68b12e5
commit
395abe0e5c
2 changed files with 4 additions and 3 deletions
|
@ -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; }
|
|
@ -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),
|
||||
|
|
Loading…
Add table
Reference in a new issue