traxxx-web/pages/actors/@actorId/revisions/+onBeforeRender.js

26 lines
520 B
JavaScript

import { fetchActorsById, fetchActorRevisions } from '#/src/actors.js';
export async function onBeforeRender(pageContext) {
const [actor] = await fetchActorsById([Number(pageContext.routeParams.actorId)], {}, pageContext.user);
const {
revisions,
avatars,
} = await fetchActorRevisions(null, {
actorId: actor.id,
isFinalized: true,
limit: 100,
}, pageContext.user);
return {
pageContext: {
title: `Revs for '${actor.name}'`,
pageProps: {
actor,
revisions,
avatars,
},
},
};
}