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

20
src/web/actors.js Normal file
View File

@@ -0,0 +1,20 @@
import { fetchActors } from '../actors.js';
export async function fetchActorsApi(req, res) {
const { actors, limit, total } = await fetchActors({
query: req.query.q,
requireAvatar: Object.hasOwn(req.query, 'avatar'),
age: req.query.age?.split(',').map((age) => Number(age)),
height: req.query.height?.split(',').map((height) => Number(height)),
weight: req.query.weight?.split(',').map((weight) => Number(weight)),
}, {
page: Number(req.query.page) || 1,
limit: Number(req.query.limit) || 50,
});
res.send({
actors,
limit,
total,
});
}