Reinitialized commit. Update and actors overview with some filters.

This commit is contained in:
2023-12-30 06:29:53 +01:00
commit 3f099b5e95
1208 changed files with 134732 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
import { fetchActors } from '#/src/actors.js';
export async function onBeforeRender(pageContext) {
const query = pageContext.urlParsed.search;
const { actors, limit, total } = await fetchActors({
query: query.q,
requireAvatar: Object.hasOwn(query, 'avatar'),
age: query.age?.split(',').map((age) => Number(age)),
height: query.height?.split(',').map((height) => Number(height)),
weight: query.weight?.split(',').map((weight) => Number(weight)),
}, {
page: Number(pageContext.routeParams.page) || 1,
limit: Number(pageContext.urlParsed.search.limit) || 50,
});
return {
pageContext: {
title: 'actors',
pageProps: {
actors,
limit,
total,
},
},
};
}