Added entity reporting.

This commit is contained in:
2026-11-13 00:23:13 +01:00
parent 6143c41668
commit 1d219850d7
18 changed files with 840 additions and 5 deletions
@@ -5,6 +5,7 @@ import { getCampaignIndex, getRandomCampaigns } from '#/src/campaigns.js';
import entityPrefixes from '#/src/entities-prefixes.js';
import { fetchEntitiesById } from '#/src/entities.js';
import { fetchMovies } from '#/src/movies.js';
import { hasOpenReport } from '#/src/reports.js';
import { fetchScenes } from '#/src/scenes.js';
import { curateMoviesQuery } from '#/src/web/movies.js';
import { curateScenesQuery } from '#/src/web/scenes.js';
@@ -50,11 +51,13 @@ export async function onBeforeRender(pageContext) {
const [
[entity],
entityReleases,
isReported,
] = await Promise.all([
fetchEntitiesById([Number(entityId)], { includeChildren: true }, pageContext.user, {
restriction: pageContext.geo.restriction,
}),
fetchReleases(pageContext, entityId),
hasOpenReport(Number(entityId), pageContext.user),
]);
const entityIds = entity.isIndependent || !entity.parent
@@ -92,6 +95,7 @@ export async function onBeforeRender(pageContext) {
title: entity.name,
pageProps: {
entity,
isReported,
...entityReleases,
},
campaigns: {