fix: update ModifyUserPhone API

This commit is contained in:
AnonymousDotNet 2024-10-22 18:56:00 +08:00
parent 4b2a94a539
commit 0f930b4c46
2 changed files with 5 additions and 1 deletions

View file

@ -636,6 +636,8 @@ public class UserService : IUserService
record.Phone = phone;
record.RegionCode = regionCode;
record.UserName = phone;
record.FirstName = phone;
var hooks = _services.GetServices<IAuthenticationHook>();
foreach (var hook in hooks)

View file

@ -133,7 +133,9 @@ public partial class MongoRepository
var filter = Builders<UserDocument>.Filter.Eq(x => x.Id, userId);
var update = Builders<UserDocument>.Update.Set(x => x.Phone, phone)
.Set(x => x.UpdatedTime, DateTime.UtcNow)
.Set(x => x.RegionCode, regionCode);
.Set(x => x.RegionCode, regionCode)
.Set(x => x.UserName, phone)
.Set(x => x.FirstName, phone);
_dc.Users.UpdateOne(filter, update);
}