Renamed minimalUser to user
This commit is contained in:
@@ -1,20 +1,20 @@
|
||||
using Hutopy.Application.Common.Interfaces;
|
||||
using Hutopy.Application.Common.Models;
|
||||
|
||||
namespace Hutopy.Application.Users.Queries.GetMinimalUser;
|
||||
namespace Hutopy.Application.Users.Queries.GetUser;
|
||||
|
||||
public record GetMinimalUserQuery : IRequest<MinimalUserDto>
|
||||
public record GetUserQuery : IRequest<UserDto>
|
||||
{
|
||||
public string? UserId { get; set; } = string.Empty;
|
||||
public string? UserName { get; set; } = string.Empty;
|
||||
};
|
||||
|
||||
public class GetMinimalUserQueryHandler(
|
||||
public class GetUserQueryHandler(
|
||||
IIdentityService identityService
|
||||
)
|
||||
: IRequestHandler<GetMinimalUserQuery, MinimalUserDto>
|
||||
: IRequestHandler<GetUserQuery, UserDto>
|
||||
{
|
||||
public async Task<MinimalUserDto> Handle(GetMinimalUserQuery request, CancellationToken cancellationToken)
|
||||
public async Task<UserDto> Handle(GetUserQuery request, CancellationToken cancellationToken)
|
||||
{
|
||||
UserModel? identityUser = null;
|
||||
|
||||
@@ -29,7 +29,7 @@ public class GetMinimalUserQueryHandler(
|
||||
identityUser = await identityService.GetUserByUserNameAsync(request.UserName);
|
||||
}
|
||||
|
||||
var user = new MinimalUserDto
|
||||
var user = new UserDto
|
||||
{
|
||||
Id = identityUser?.Id ?? string.Empty,
|
||||
FirstName = identityUser?.FirstName ?? string.Empty,
|
||||
@@ -1,8 +1,8 @@
|
||||
using Hutopy.Application.Users.Models;
|
||||
|
||||
namespace Hutopy.Application.Users.Queries.GetMinimalUser;
|
||||
namespace Hutopy.Application.Users.Queries.GetUser;
|
||||
|
||||
public class MinimalUserDto
|
||||
public class UserDto
|
||||
{
|
||||
public required string Id { get; init; }
|
||||
public required string FirstName { get; init; }
|
||||
@@ -1,5 +1,5 @@
|
||||
using Hutopy.Application.Users.Commands;
|
||||
using Hutopy.Application.Users.Queries.GetMinimalUser;
|
||||
using Hutopy.Application.Users.Queries.GetUser;
|
||||
|
||||
namespace Hutopy.Web.Endpoints;
|
||||
|
||||
@@ -11,7 +11,7 @@ public class Users : EndpointGroupBase
|
||||
.MapPost(CreateUser)
|
||||
.MapPost(Login, "/login")
|
||||
.MapPost(UploadProfilePicture, "/upload-profile-picture")
|
||||
.MapGet(GetMinimalUser);
|
||||
.MapGet(GetUser);
|
||||
}
|
||||
|
||||
private static async Task<Guid> CreateUser(ISender sender, CreateUserCommand command)
|
||||
@@ -19,7 +19,7 @@ public class Users : EndpointGroupBase
|
||||
return await sender.Send(command);
|
||||
}
|
||||
|
||||
private static async Task<MinimalUserDto> GetMinimalUser(ISender sender, [AsParameters] GetMinimalUserQuery query)
|
||||
private static async Task<UserDto> GetUser(ISender sender, [AsParameters] GetUserQuery query)
|
||||
{
|
||||
return await sender.Send(query);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user