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

26 lines
520 B
JavaScript
Raw Normal View History

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