Various bug fixes (#3667)
This commit is contained in:
parent
a1d3aef39b
commit
1ad8a360cb
17 changed files with 73 additions and 32 deletions
|
@ -351,8 +351,10 @@ public class ReadingListRepository : IReadingListRepository
|
|||
|
||||
public async Task<ReadingListDto?> GetReadingListDtoByIdAsync(int readingListId, int userId)
|
||||
{
|
||||
var user = await _context.AppUser.FirstAsync(u => u.Id == userId);
|
||||
return await _context.ReadingList
|
||||
.Where(r => r.Id == readingListId && (r.AppUserId == userId || r.Promoted))
|
||||
.RestrictAgainstAgeRestriction(user.GetAgeRestriction())
|
||||
.ProjectTo<ReadingListDto>(_mapper.ConfigurationProvider)
|
||||
.SingleOrDefaultAsync();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue