25 lines
535 B
JavaScript
25 lines
535 B
JavaScript
import { fetchActorsById } from '#/src/actors.js';
|
|
import { fetchSceneRevisions } from '#/src/scenes.js';
|
|
|
|
export async function onBeforeRender(pageContext) {
|
|
const [actor] = await fetchActorsById([Number(pageContext.routeParams.actorId)], {}, pageContext.user);
|
|
|
|
const {
|
|
revisions,
|
|
} = await fetchSceneRevisions(null, {
|
|
sceneId: actor.id,
|
|
isFinalized: true,
|
|
limit: 100,
|
|
}, pageContext.user);
|
|
|
|
return {
|
|
pageContext: {
|
|
title: `Revisions for '${actor.name}'`,
|
|
pageProps: {
|
|
actor,
|
|
revisions,
|
|
},
|
|
},
|
|
};
|
|
}
|