Merge remote-tracking branch 'origin/feature/update-current-user' into feature/update-current-user
# Conflicts: # src/Application/Common/Interfaces/IIdentityService.cs # src/Application/Common/Models/Result.cs # src/Application/Common/Models/UserModel.cs # src/Application/Users/Commands/UpdateCurrentUserCommand.cs # src/Application/Users/Models/SocialNetworksModel.cs # src/Application/Users/Queries/GetCurrentUser/GetCurrentUser.cs # src/Application/Users/Queries/GetCurrentUser/UserDto.cs # src/Infrastructure/Identity/ApplicationUser.cs # src/Infrastructure/Identity/IdentityService.cs # src/Infrastructure/Utils/GenerateJwtToken.cs # src/Web/Controllers/GoogleController.cs # src/Web/Endpoints/UpdateMyUser.cs
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using Hutopy.Application.Common.Interfaces;
|
||||
using Hutopy.Application.Common.Models;
|
||||
using Hutopy.Application.Users.Models;
|
||||
@@ -19,6 +19,8 @@ public class UpdateCurrentUserCommand : IRequest<string>
|
||||
public required string Description { get; init; }
|
||||
public required SocialNetworksModel SocialNetworks { get; init; }
|
||||
public required ProfileColorsModel ProfileColors { get; init; }
|
||||
public string PortraitUrl { get; init; } = string.Empty;
|
||||
|
||||
|
||||
[NotMapped]
|
||||
private class Mapping : Profile
|
||||
@@ -42,7 +44,7 @@ public class UpdateCurrentUserCommandHandler(IApplicationDbContext context, IIde
|
||||
var userModel = mapper.Map<UserModel>(request);
|
||||
userModel.Id = identityUser.Id;
|
||||
|
||||
var result = await identityService.UpdateCurrentUserAsync(userModel);
|
||||
var result = await identityService.UpdateCurrentUserAsync(userModel, request.PortraitUrl);
|
||||
|
||||
await context.SaveChangesAsync(cancellationToken);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user