Enabled RO Collections Admin API

The future work around collections requires the read only portions
of the Collections Admin API to be enabled without a flag.

The write endpoints are only for custom collections which aren't required.
This commit is contained in:
Fabien 'egg' O'Carroll 2023-08-28 13:49:09 +07:00 committed by GitHub
parent 3960bfac1d
commit c1a9f2d6a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,9 +20,9 @@ module.exports = function apiRoutes() {
router.post('/mail_events', mw.publicAdminApi, http(api.mailEvents.add));
// ## Collections
router.get('/collections', mw.authAdminApi, labs.enabledMiddleware('collections'), http(api.collections.browse));
router.get('/collections/:id', mw.authAdminApi, labs.enabledMiddleware('collections'), http(api.collections.read));
router.get('/collections/slug/:slug', mw.authAdminApi, labs.enabledMiddleware('collections'), http(api.collections.read));
router.get('/collections', mw.authAdminApi, http(api.collections.browse));
router.get('/collections/:id', mw.authAdminApi, http(api.collections.read));
router.get('/collections/slug/:slug', mw.authAdminApi, http(api.collections.read));
router.post('/collections', mw.authAdminApi, labs.enabledMiddleware('collections'), http(api.collections.add));
router.put('/collections/:id', mw.authAdminApi, labs.enabledMiddleware('collections'), http(api.collections.edit));
router.del('/collections/:id', mw.authAdminApi, labs.enabledMiddleware('collections'), http(api.collections.destroy));