mirror of
https://github.com/QuotifyTeam/QuotifyBE.git
synced 2025-12-16 11:20:05 +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
|
IQueryable<Quote> query = _db.Quotes
|
||||||
.Include(q => q.QuoteCategories!)
|
.Include(q => q.QuoteCategories!)
|
||||||
.ThenInclude(qc => qc.Category);
|
.ThenInclude(qc => qc.Category)
|
||||||
|
.Include(q => q.Image);
|
||||||
|
|
||||||
if (category_id.HasValue)
|
if (category_id.HasValue)
|
||||||
{
|
{
|
||||||
@@ -278,8 +279,6 @@ public class QuotesController : ControllerBase
|
|||||||
var skip = random.Next(0, totalQuotes);
|
var skip = random.Next(0, totalQuotes);
|
||||||
|
|
||||||
var quote = await query
|
var quote = await query
|
||||||
.Include(q => q.QuoteCategories!)
|
|
||||||
.ThenInclude(qc => qc.Category)
|
|
||||||
.Skip(skip)
|
.Skip(skip)
|
||||||
.Take(1)
|
.Take(1)
|
||||||
.FirstOrDefaultAsync();
|
.FirstOrDefaultAsync();
|
||||||
|
|||||||
Reference in New Issue
Block a user