diff options
author | crupest <crupest@outlook.com> | 2020-12-18 22:40:22 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-12-18 22:40:22 +0800 |
commit | b102ed3edf1330e77240708afb59ec8f91d67b41 (patch) | |
tree | d9d0006436c8edd114048a082683a9c2b25478fd /BackEnd/Timeline/Services/BookmarkTimelineService.cs | |
parent | 61630cf39af0f74f102f772ed0f3ca4a73731e11 (diff) | |
download | timeline-b102ed3edf1330e77240708afb59ec8f91d67b41.tar.gz timeline-b102ed3edf1330e77240708afb59ec8f91d67b41.tar.bz2 timeline-b102ed3edf1330e77240708afb59ec8f91d67b41.zip |
feat: Bookmark timeline service unit tests.
Diffstat (limited to 'BackEnd/Timeline/Services/BookmarkTimelineService.cs')
-rw-r--r-- | BackEnd/Timeline/Services/BookmarkTimelineService.cs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/BackEnd/Timeline/Services/BookmarkTimelineService.cs b/BackEnd/Timeline/Services/BookmarkTimelineService.cs index f65a1ff0..09438193 100644 --- a/BackEnd/Timeline/Services/BookmarkTimelineService.cs +++ b/BackEnd/Timeline/Services/BookmarkTimelineService.cs @@ -109,7 +109,7 @@ namespace Timeline.Services if (!await _userService.CheckUserExistence(userId))
throw new UserNotExistException(userId);
- var entities = await _database.BookmarkTimelines.Where(t => t.UserId == userId).Select(t => new { t.TimelineId }).ToListAsync();
+ var entities = await _database.BookmarkTimelines.Where(t => t.UserId == userId).OrderBy(t => t.Rank).Select(t => new { t.TimelineId }).ToListAsync();
List<TimelineInfo> result = new();
@@ -140,7 +140,7 @@ namespace Timeline.Services }
else
{
- var totalCount = await _database.HighlightTimelines.CountAsync();
+ var totalCount = await _database.BookmarkTimelines.CountAsync(t => t.UserId == userId);
if (newPosition > totalCount) newPosition = totalCount;
}
|