diff --git a/backend/controllers/itemController.js b/backend/controllers/itemController.js index 9e46a33b..037f9ccf 100644 --- a/backend/controllers/itemController.js +++ b/backend/controllers/itemController.js @@ -32,13 +32,14 @@ module.exports = { } }, - // GET /item/algolia + // GET /item/algolia?query= algoliaSearch: async (req, res) => { try { - const query = req.params.query; + const query = req.query.query; const result = await algolia.search(query, { - filters: `status:"modified" AND NOT accessGroups.read:"${res.locals.group}"`, + // filters: `NOT status:"modified" AND accessGroups.read:"${res.locals.group.toString()}"` + filters: `NOT status:"modified"` }); res.status(200).send(result.hits); diff --git a/backend/routes/api/item.js b/backend/routes/api/item.js index 08b4782e..f540edfb 100644 --- a/backend/routes/api/item.js +++ b/backend/routes/api/item.js @@ -3,7 +3,7 @@ const router = express.Router(); const itemController = require("../../controllers/itemController.js"); router.get("", itemController.search); -router.get("/algolia/:query", itemController.algoliaSearch); +router.get("/algolia", itemController.algoliaSearch); router.get("/:item_id", itemController.read); router.post("/", itemController.create); router.put("/:item_id", itemController.update);