2024-10-22 23:28:54 +00:00
|
|
|
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,
|
2024-10-22 23:28:54 +00:00
|
|
|
avatars,
|
|
|
|
} = await fetchActorRevisions(null, {
|
|
|
|
actorId: actor.id,
|
2024-10-22 01:12:42 +00:00
|
|
|
isFinalized: true,
|
|
|
|
limit: 100,
|
|
|
|
}, pageContext.user);
|
|
|
|
|
|
|
|
return {
|
|
|
|
pageContext: {
|
2024-10-22 23:28:54 +00:00
|
|
|
title: `Revs for '${actor.name}'`,
|
2024-10-22 01:12:42 +00:00
|
|
|
pageProps: {
|
|
|
|
actor,
|
|
|
|
revisions,
|
2024-10-22 23:28:54 +00:00
|
|
|
avatars,
|
2024-10-22 01:12:42 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
}
|