mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-24 19:33:02 +03:00
Removed /collections/:id/posts endpoint
refs https://github.com/TryGhost/Arch/issues/16 - We made a decision to limit the API for fetching posts belonging to a certain collection to only the Posts API. The endpoint on the collections was an experiment that only brings unnecessary maintenance at this point of time.
This commit is contained in:
parent
9a38c65ee6
commit
08c06129d3
@ -25,25 +25,6 @@ module.exports = {
|
||||
}
|
||||
},
|
||||
|
||||
browsePosts: {
|
||||
headers: {
|
||||
cacheInvalidate: false
|
||||
},
|
||||
data: [
|
||||
'id'
|
||||
],
|
||||
options: [
|
||||
'limit',
|
||||
'page'
|
||||
],
|
||||
permissions: {
|
||||
method: 'browse'
|
||||
},
|
||||
query(frame) {
|
||||
return collectionsService.api.getAllPosts(frame.data.id, frame.options);
|
||||
}
|
||||
},
|
||||
|
||||
read: {
|
||||
headers: {
|
||||
cacheInvalidate: false
|
||||
|
@ -1,10 +0,0 @@
|
||||
const collectionPostsMapper = require('./mappers/collection-posts');
|
||||
|
||||
module.exports = {
|
||||
browsePosts(response, apiConfig, frame) {
|
||||
frame.response = {
|
||||
collection_posts: response.data.map(model => collectionPostsMapper(model)),
|
||||
meta: response.meta
|
||||
};
|
||||
}
|
||||
};
|
@ -21,10 +21,6 @@ module.exports = {
|
||||
return require('./authentication');
|
||||
},
|
||||
|
||||
get collections() {
|
||||
return require('./collections');
|
||||
},
|
||||
|
||||
get db() {
|
||||
return require('./db');
|
||||
},
|
||||
|
@ -25,7 +25,6 @@ module.exports = function apiRoutes() {
|
||||
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));
|
||||
router.get('/collections/:id/posts', mw.authAdminApi, labs.enabledMiddleware('collections'), http(api.collections.browsePosts));
|
||||
|
||||
// ## Configuration
|
||||
router.get('/config', mw.authAdminApi, http(api.config.read));
|
||||
|
Loading…
Reference in New Issue
Block a user