26 lines
776 B
C#
26 lines
776 B
C#
using Hutopy.Application.Users.Queries;
|
|
using Hutopy.Application.Users.Queries.GetCurrentUser;
|
|
|
|
namespace Hutopy.Web.Endpoints;
|
|
|
|
public class GetMyUser : EndpointGroupBase
|
|
{
|
|
public override void Map(WebApplication app)
|
|
{
|
|
app.MapGroup(this)
|
|
.RequireAuthorization()
|
|
.MapGet(GetCurrentUser)
|
|
.MapGet(GetCurrentUserProfilePicture, "profile-picture");
|
|
}
|
|
|
|
private static async Task<UserDto> GetCurrentUser(ISender sender, [AsParameters] GetCurrentUserQuery query)
|
|
{
|
|
return await sender.Send(query);
|
|
}
|
|
|
|
private static async Task<Stream> GetCurrentUserProfilePicture(ISender sender, [AsParameters] GetCurrentUserProfilePictureQuery query)
|
|
{
|
|
return await sender.Send(query);
|
|
}
|
|
}
|