2024-01-07 05:13:40 +00:00
|
|
|
import { fetchScenes } from '#/src/scenes.js';
|
2023-12-30 05:29:53 +00:00
|
|
|
|
|
|
|
export async function onBeforeRender(pageContext) {
|
2024-01-07 05:13:40 +00:00
|
|
|
const { scenes, limit, total } = await fetchScenes({
|
|
|
|
scope: pageContext.routeParams.scope || 'latest',
|
|
|
|
}, {
|
|
|
|
page: Number(pageContext.routeParams.page) || 1,
|
|
|
|
limit: Number(pageContext.urlParsed.search.limit) || 30,
|
|
|
|
aggregate: false,
|
|
|
|
});
|
2023-12-30 05:29:53 +00:00
|
|
|
|
|
|
|
return {
|
|
|
|
pageContext: {
|
|
|
|
title: pageContext.routeParams.scope,
|
|
|
|
pageProps: {
|
|
|
|
scenes,
|
|
|
|
limit,
|
|
|
|
total,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
};
|
|
|
|
}
|