aboutsummaryrefslogtreecommitdiff
path: root/BackEnd/Timeline/Services/BookmarkTimelineService.cs
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-12-18 22:40:22 +0800
committercrupest <crupest@outlook.com>2020-12-18 22:40:22 +0800
commitb102ed3edf1330e77240708afb59ec8f91d67b41 (patch)
treed9d0006436c8edd114048a082683a9c2b25478fd /BackEnd/Timeline/Services/BookmarkTimelineService.cs
parent61630cf39af0f74f102f772ed0f3ca4a73731e11 (diff)
downloadtimeline-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.cs4
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;
}