Chapter/Issue level Reviews and Ratings (#3778)

Co-authored-by: Joseph Milazzo <josephmajora@gmail.com>
This commit is contained in:
Fesaa
2025-04-29 18:53:24 +02:00
committed by GitHub
parent 3b8997e46e
commit 4f7625ea77
60 changed files with 5097 additions and 497 deletions
@@ -1,6 +1,7 @@
using System.Linq;
using API.Data.Repositories;
using API.Entities;
using API.Entities.Metadata;
using Microsoft.EntityFrameworkCore;
namespace API.Extensions.QueryExtensions;
@@ -72,6 +73,12 @@ public static class IncludesExtensions
.Include(c => c.Tags);
}
if (includes.HasFlag(ChapterIncludes.ExternalReviews))
{
queryable = queryable
.Include(c => c.ExternalReviews);
}
return queryable.AsSplitQuery();
}
@@ -253,6 +260,11 @@ public static class IncludesExtensions
.ThenInclude(c => c.Items);
}
if (includeFlags.HasFlag(AppUserIncludes.ChapterRatings))
{
query = query.Include(u => u.ChapterRatings);
}
return query.AsSplitQuery();
}