mirror of
https://github.com/QuotifyTeam/QuotifyBE.git
synced 2025-12-16 02:30:08 +01:00
fix: load images for randomly drawn quotes
This commit is contained in:
@@ -255,7 +255,8 @@ public class QuotesController : ControllerBase
|
||||
{
|
||||
IQueryable<Quote> query = _db.Quotes
|
||||
.Include(q => q.QuoteCategories!)
|
||||
.ThenInclude(qc => qc.Category);
|
||||
.ThenInclude(qc => qc.Category)
|
||||
.Include(q => q.Image);
|
||||
|
||||
if (category_id.HasValue)
|
||||
{
|
||||
@@ -278,8 +279,6 @@ public class QuotesController : ControllerBase
|
||||
var skip = random.Next(0, totalQuotes);
|
||||
|
||||
var quote = await query
|
||||
.Include(q => q.QuoteCategories!)
|
||||
.ThenInclude(qc => qc.Category)
|
||||
.Skip(skip)
|
||||
.Take(1)
|
||||
.FirstOrDefaultAsync();
|
||||
|
||||
Reference in New Issue
Block a user