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
commitab3aedad37fe4634efb0d6939d7a40642bfff032 (patch)
tree4201ce9060ea097da9b4a3f15d40e4c9073f3a79 /BackEnd/Timeline/Services/BookmarkTimelineService.cs
parent53291d2c16047d3eb4c5eeb9a216c106cf47ead3 (diff)
downloadtimeline-ab3aedad37fe4634efb0d6939d7a40642bfff032.tar.gz
timeline-ab3aedad37fe4634efb0d6939d7a40642bfff032.tar.bz2
timeline-ab3aedad37fe4634efb0d6939d7a40642bfff032.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;
}