From f3c7912caec2e9eee8a685d8751894f357528a71 Mon Sep 17 00:00:00 2001 From: crupest Date: Tue, 19 Nov 2019 23:18:45 +0800 Subject: Complete integrated tests??? Fix bugs. --- Timeline/Services/TimelineService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Timeline/Services/TimelineService.cs') diff --git a/Timeline/Services/TimelineService.cs b/Timeline/Services/TimelineService.cs index 1e64353c..a2ff4098 100644 --- a/Timeline/Services/TimelineService.cs +++ b/Timeline/Services/TimelineService.cs @@ -605,12 +605,12 @@ namespace Timeline.Services var timelineEntity = await Database.Timelines.Where(t => t.Id == timelineId).Select(t => new { t.OwnerId }).SingleAsync(); - var postEntity = await Database.Timelines.Where(p => p.Id == id).Select(p => new { p.OwnerId }).SingleOrDefaultAsync(); + var postEntity = await Database.TimelinePosts.Where(p => p.Id == id).Select(p => new { p.AuthorId }).SingleOrDefaultAsync(); if (postEntity == null) throw new TimelinePostNotExistException(id); - return timelineEntity.OwnerId == userId || postEntity.OwnerId == userId; + return timelineEntity.OwnerId == userId || postEntity.AuthorId == userId; } public async Task IsMemberOf(string name, string username) -- cgit v1.2.3