traxxx-web/pages/scene/revisions/+onBeforeRender.js

35 lines
640 B
JavaScript
Raw Normal View History

import { fetchScenesById, fetchSceneRevisions } from '#/src/scenes.js';
export async function onBeforeRender(pageContext) {
const [scene] = await fetchScenesById([Number(pageContext.routeParams.sceneId)], {
reqUser: pageContext.user,
includeAssets: true,
includePartOf: true,
actorStashes: true,
});
const {
revisions,
actors,
tags,
movies,
} = await fetchSceneRevisions(null, {
sceneId: scene.id,
isFinalized: true,
limit: 100,
}, pageContext.user);
return {
pageContext: {
title: `Revs for '${scene.title}'`,
pageProps: {
scene,
revisions,
actors,
tags,
movies,
},
},
};
}