Logs for blob storage and some improvements
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
using Hutopy.Application.Common.Interfaces;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
|
||||
namespace Hutopy.Application.Users.Commands;
|
||||
public record CreateUserCommand : IRequest<Guid>
|
||||
public record CreateUserCommand : IRequest<IResult>
|
||||
{
|
||||
public required string FirstName { get; init; }
|
||||
public required string LastName { get; init; }
|
||||
@@ -10,7 +11,7 @@ public record CreateUserCommand : IRequest<Guid>
|
||||
public required string Password { get; init; }
|
||||
}
|
||||
|
||||
public class CreateUserCommandHandler : IRequestHandler<CreateUserCommand, Guid>
|
||||
public class CreateUserCommandHandler : IRequestHandler<CreateUserCommand, IResult>
|
||||
{
|
||||
private readonly IApplicationDbContext _context;
|
||||
private readonly IIdentityService _identityService;
|
||||
@@ -21,7 +22,7 @@ public class CreateUserCommandHandler : IRequestHandler<CreateUserCommand, Guid>
|
||||
_identityService = identityService;
|
||||
}
|
||||
|
||||
public async Task<Guid> Handle(CreateUserCommand request, CancellationToken cancellationToken)
|
||||
public async Task<IResult> Handle(CreateUserCommand request, CancellationToken cancellationToken)
|
||||
{
|
||||
await _identityService.CreateUserAsync(request.EmailAddress, request.UserName, request.FirstName, request.LastName, request.Password);
|
||||
|
||||
@@ -29,6 +30,6 @@ public class CreateUserCommandHandler : IRequestHandler<CreateUserCommand, Guid>
|
||||
|
||||
await _context.SaveChangesAsync(cancellationToken);
|
||||
|
||||
return new Guid(user?.Id ?? string.Empty);
|
||||
return Results.Ok(new Guid(user?.Id ?? string.Empty));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user