From ceb1829eb9689caefa4ec2062582ee5110224129 Mon Sep 17 00:00:00 2001 From: eee4 <41441600+eee4@users.noreply.github.com> Date: Wed, 23 Jul 2025 09:58:28 +0200 Subject: [PATCH] fix: load images for randomly drawn quotes --- Controllers/QuoteController.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Controllers/QuoteController.cs b/Controllers/QuoteController.cs index 6ff2fc7..fc3cce2 100644 --- a/Controllers/QuoteController.cs +++ b/Controllers/QuoteController.cs @@ -255,7 +255,8 @@ public class QuotesController : ControllerBase { IQueryable 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();