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

View File

@@ -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) {