aboutsummaryrefslogtreecommitdiff
path: root/Timeline/Services/TimelineService.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Timeline/Services/TimelineService.cs')
-rw-r--r--Timeline/Services/TimelineService.cs6
1 files changed, 4 insertions, 2 deletions
diff --git a/Timeline/Services/TimelineService.cs b/Timeline/Services/TimelineService.cs
index a2ff4098..9ae9dc1c 100644
--- a/Timeline/Services/TimelineService.cs
+++ b/Timeline/Services/TimelineService.cs
@@ -348,7 +348,7 @@ namespace Timeline.Services
throw new ArgumentNullException(nameof(name));
var timelineId = await FindTimelineId(name);
- var postEntities = await Database.TimelinePosts.Where(p => p.TimelineId == timelineId).ToListAsync();
+ var postEntities = await Database.TimelinePosts.Where(p => p.TimelineId == timelineId && p.Content != null).ToListAsync();
var posts = new List<TimelinePostInfo>(await Task.WhenAll(postEntities.Select(async p => new TimelinePostInfo
{
Id = p.Id,
@@ -418,7 +418,9 @@ namespace Timeline.Services
if (post == null)
throw new TimelinePostNotExistException(id);
- Database.TimelinePosts.Remove(post);
+ post.Content = null;
+ post.LastUpdated = Clock.GetCurrentTime();
+
await Database.SaveChangesAsync();
}