2024-10-06 00:45:56 +00:00
|
|
|
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: {
|
2024-10-22 23:28:54 +00:00
|
|
|
title: `Revs for '${scene.title}'`,
|
2024-10-06 00:45:56 +00:00
|
|
|
pageProps: {
|
|
|
|
scene,
|
|
|
|
revisions,
|
|
|
|
actors,
|
|
|
|
tags,
|
|
|
|
movies,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
}
|