Added actor profile revisions.
This commit is contained in:
24
pages/actors/@actorId/revisions/+onBeforeRender.js
Normal file
24
pages/actors/@actorId/revisions/+onBeforeRender.js
Normal file
@@ -0,0 +1,24 @@
|
||||
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,
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user