Fixed search breaking due missing restrictions, added restrictions to API calls.
This commit is contained in:
@@ -68,7 +68,9 @@ async function fetchScenesApi(req, res) {
|
||||
}), {
|
||||
page: Number(req.query.page) || 1,
|
||||
limit: Number(req.query.limit) || 30,
|
||||
}, req.user);
|
||||
}, req.user, {
|
||||
restriction: req.restriction,
|
||||
});
|
||||
|
||||
res.send(stringify({
|
||||
scenes,
|
||||
@@ -250,7 +252,7 @@ export async function fetchScenesGraphql(query, req) {
|
||||
}
|
||||
|
||||
async function fetchSceneApi(req, res) {
|
||||
const [scene] = await fetchScenesById([Number(req.params.sceneId)], { reqUser: req.user });
|
||||
const [scene] = await fetchScenesById([Number(req.params.sceneId)], { reqUser: req.user }, { restriction: req.restriction });
|
||||
|
||||
if (!scene) {
|
||||
throw new HttpError(`No scene with ID ${req.params.sceneId} found`, 404);
|
||||
@@ -263,6 +265,7 @@ export async function fetchScenesByIdGraphql(query, req) {
|
||||
const scenes = await fetchScenesById([].concat(query.id, query.ids).filter(Boolean), {
|
||||
reqUser: req.user,
|
||||
includePartOf: true,
|
||||
restriction: req.restriction,
|
||||
});
|
||||
|
||||
if (query.ids) {
|
||||
|
||||
Reference in New Issue
Block a user