Skip to content

Commit

Permalink
fix: unexpected pin
Browse files Browse the repository at this point in the history
  • Loading branch information
GZTimeWalker committed Sep 5, 2022
1 parent 8e884a7 commit 17caffb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions GZCTF/Models/Data/Post.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@ public class Post
internal Post Update(PostEditModel model, UserInfo user)
{
Title = model.Title;
Summary = model.Summary;
Content = model.Content;
Summary = string.IsNullOrEmpty(model.Summary) ? Summary : model.Summary;
Content = string.IsNullOrEmpty(model.Content) ? Content : model.Content;
IsPinned = model.IsPinned;
Tags = model.Tags.ToList();
Tags = model.Tags.Length > 0 ? model.Tags.ToList() : Tags;
Auther = user;
AutherId = user.Id;
UpdateTimeUTC = DateTimeOffset.UtcNow;
Expand Down

0 comments on commit 17caffb

Please sign in to comment.