Fixed search breaking due missing restrictions, added restrictions to API calls.

This commit is contained in:
2026-02-04 06:37:41 +01:00
parent 6c8fce49d6
commit a1e080c20d
9 changed files with 22 additions and 15 deletions
+3 -3
View File
@@ -33,7 +33,7 @@ export async function fetchMoviesApi(req, res) {
} = await fetchMovies(await curateMoviesQuery(req.query), {
page: Number(req.query.page) || 1,
limit: Number(req.query.limit) || 30,
}, req.user);
}, req.user, { restriction: req.restriction });
res.send(stringify({
movies,
@@ -47,7 +47,7 @@ export async function fetchMoviesApi(req, res) {
}
export async function fetchMovieApi(req, res) {
const [movie] = await fetchMoviesById([Number(req.params.movieId)], { reqUser: req.user });
const [movie] = await fetchMoviesById([Number(req.params.movieId)], { reqUser: req.user }, { restriction: req.restriction });
if (!movie) {
throw new HttpError(`No movie with ID ${req.params.movieId} found`, 404);
@@ -137,7 +137,7 @@ export async function fetchMoviesGraphql(query, req) {
page: query.page || 1,
limit: query.limit || 30,
aggregate: false,
}, req.user);
}, req.user, { restriction: req.restriction });
return {
nodes: movies,