Skip to content

Commit

Permalink
include latest condition log when retrieving plants by collections
Browse files Browse the repository at this point in the history
  • Loading branch information
juuwel committed May 20, 2024
1 parent bdba818 commit 6bd79c4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions Infrastructure/Repositories/PlantRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public async Task<List<Plant>> GetPlantsForCollection(Guid collectionId)
await using var context = await dbContextFactory.CreateDbContextAsync();
return await context.Plants
.Include(plant => plant.Requirements)
.Include(plant => plant.ConditionsLogs.OrderByDescending(log => log.TimeStamp).Take(1))
.Where(p => p.CollectionId == collectionId)
.ToListAsync();
}
Expand Down

0 comments on commit 6bd79c4

Please sign in to comment.