From 96fde596a253be7680a9ef84435e979ced291f4e Mon Sep 17 00:00:00 2001 From: Konstantin Savosteev Date: Wed, 24 Jul 2024 15:09:43 +0200 Subject: [PATCH] fix: Customer use type for invited users --- .../Commands/InviteUserCommandHandler.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/VirtoCommerce.ProfileExperienceApiModule.Data/Commands/InviteUserCommandHandler.cs b/src/VirtoCommerce.ProfileExperienceApiModule.Data/Commands/InviteUserCommandHandler.cs index 4bd168c4..5cdbdf04 100644 --- a/src/VirtoCommerce.ProfileExperienceApiModule.Data/Commands/InviteUserCommandHandler.cs +++ b/src/VirtoCommerce.ProfileExperienceApiModule.Data/Commands/InviteUserCommandHandler.cs @@ -25,6 +25,8 @@ namespace VirtoCommerce.ProfileExperienceApiModule.Data.Commands { public class InviteUserCommandHandler : IRequestHandler { + private const string _userType = "Customer"; + private readonly IWebHostEnvironment _environment; private readonly Func> _userManagerFactory; private readonly Func> _roleManagerFactory; @@ -62,7 +64,7 @@ public virtual async Task Handle(InviteUserCommand reque using var userManager = _userManagerFactory(); var contact = CreateContact(request, email); - + await _memberService.SaveChangesAsync(new Member[] { contact }); var user = CreateUser(request, contact, email); @@ -132,7 +134,8 @@ protected virtual ApplicationUser CreateUser(InviteUserCommand request, Contact UserName = email, Email = email, MemberId = contact.Id, - StoreId = request.StoreId + StoreId = request.StoreId, + UserType = _userType, }; }