aboutsummaryrefslogtreecommitdiff
path: root/Timeline/Services/TimelineService.cs
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-08-28 00:01:04 +0800
committercrupest <crupest@outlook.com>2020-08-28 00:01:04 +0800
commit12410a51fb2e5f55e8d83415bc3c4053a146ce3b (patch)
tree920ef556df34e0d69d990f8bf3ef2fdce13f9f46 /Timeline/Services/TimelineService.cs
parentc10dc9e221317ea39f9ce0f172670ffbe94e6f8a (diff)
downloadtimeline-12410a51fb2e5f55e8d83415bc3c4053a146ce3b.tar.gz
timeline-12410a51fb2e5f55e8d83415bc3c4053a146ce3b.tar.bz2
timeline-12410a51fb2e5f55e8d83415bc3c4053a146ce3b.zip
Add change timeline name api to timeline controller.
Diffstat (limited to 'Timeline/Services/TimelineService.cs')
-rw-r--r--Timeline/Services/TimelineService.cs3
1 files changed, 2 insertions, 1 deletions
diff --git a/Timeline/Services/TimelineService.cs b/Timeline/Services/TimelineService.cs
index 0a3a2076..4bcae596 100644
--- a/Timeline/Services/TimelineService.cs
+++ b/Timeline/Services/TimelineService.cs
@@ -411,6 +411,7 @@ namespace Timeline.Services
}
}
+ /// Remember to include Members when query.
private async Task<Models.Timeline> MapTimelineFromEntity(TimelineEntity entity)
{
var owner = await _userService.GetUserById(entity.OwnerId);
@@ -1138,7 +1139,7 @@ namespace Timeline.Services
ValidateTimelineName(oldTimelineName, nameof(oldTimelineName));
ValidateTimelineName(newTimelineName, nameof(newTimelineName));
- var entity = await _database.Timelines.Where(t => t.Name == oldTimelineName).SingleOrDefaultAsync();
+ var entity = await _database.Timelines.Include(t => t.Members).Where(t => t.Name == oldTimelineName).SingleOrDefaultAsync();
if (entity == null)
throw new TimelineNotExistException(oldTimelineName);