From ab3aedad37fe4634efb0d6939d7a40642bfff032 Mon Sep 17 00:00:00 2001 From: crupest Date: Fri, 18 Dec 2020 22:40:22 +0800 Subject: feat: Bookmark timeline service unit tests. --- BackEnd/Timeline/Services/BookmarkTimelineService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'BackEnd/Timeline/Services/BookmarkTimelineService.cs') 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 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; } -- cgit v1.2.3