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
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
60 changed files with 5097 additions and 497 deletions

View file

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