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 | ab3aedad37fe4634efb0d6939d7a40642bfff032 (patch) | |
tree | 4201ce9060ea097da9b4a3f15d40e4c9073f3a79 /BackEnd/Timeline | |
parent | 53291d2c16047d3eb4c5eeb9a216c106cf47ead3 (diff) | |
download | timeline-ab3aedad37fe4634efb0d6939d7a40642bfff032.tar.gz timeline-ab3aedad37fe4634efb0d6939d7a40642bfff032.tar.bz2 timeline-ab3aedad37fe4634efb0d6939d7a40642bfff032.zip |
feat: Bookmark timeline service unit tests.
Diffstat (limited to 'BackEnd/Timeline')
-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;
}
|