Fixed search breaking due missing restrictions, added restrictions to API calls.
This commit is contained in:
+3
-3
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user