From 5aaa4f95e6bdd46e6740c1ecbbd46bdf415eedd2 Mon Sep 17 00:00:00 2001 From: crupest Date: Thu, 30 Jan 2020 23:49:02 +0800 Subject: Finish reafctor, TODO: Database migration. --- Timeline/Services/TimelineService.cs | 2 +- Timeline/Services/UserService.cs | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'Timeline/Services') diff --git a/Timeline/Services/TimelineService.cs b/Timeline/Services/TimelineService.cs index 89936aa2..16402f3e 100644 --- a/Timeline/Services/TimelineService.cs +++ b/Timeline/Services/TimelineService.cs @@ -295,7 +295,7 @@ namespace Timeline.Services { if (entity.Content != null) // otherwise it is deleted { - var author = Mapper.Map(UserService.GetUserById(entity.AuthorId)); + var author = Mapper.Map(await UserService.GetUserById(entity.AuthorId)); posts.Add(new TimelinePostInfo { Id = entity.Id, diff --git a/Timeline/Services/UserService.cs b/Timeline/Services/UserService.cs index 1197bb73..d2dc969e 100644 --- a/Timeline/Services/UserService.cs +++ b/Timeline/Services/UserService.cs @@ -300,12 +300,14 @@ namespace Timeline.Services var administrator = info.Administrator ?? false; var password = info.Password; + var nickname = info.Nickname; var newEntity = new UserEntity { Username = username, Password = _passwordService.HashPassword(password), Roles = UserRoleConvert.ToString(administrator), + Nickname = nickname, Version = 1 }; _databaseContext.Users.Add(newEntity); -- cgit v1.2.3