fix: load images for randomly drawn quotes

This commit is contained in:
2025-07-23 09:58:28 +02:00
parent a1086b94f1
commit ceb1829eb9

View File

@@ -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();