0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00

Removed required webmentions flag for mentions admin endpoint

fixes https://github.com/TryGhost/Product/issues/3830

This endpoint is required for recommendations to work: admin-x loads the incoming recommendations by querying the mentions endpoint. If the mentions flag was not enabled, this endpoint wasn't available.
This commit is contained in:
Simon Backx 2023-09-19 17:13:41 +02:00 committed by Simon Backx
parent 1b004af184
commit 64b472166c
2 changed files with 1 additions and 8 deletions

View file

@ -46,7 +46,7 @@ module.exports = function apiRoutes() {
router.del('/posts/:id', mw.authAdminApi, http(api.posts.destroy));
router.post('/posts/:id/copy', mw.authAdminApi, http(api.posts.copy));
router.get('/mentions', labs.enabledMiddleware('webmentions'), mw.authAdminApi, http(api.mentions.browse));
router.get('/mentions', mw.authAdminApi, http(api.mentions.browse));
router.put('/comments/:id', mw.authAdminApi, http(api.comments.edit));

View file

@ -14,7 +14,6 @@ describe('Mentions API', function () {
before(async function () {
agent = await agentProvider.getAdminAPIAgent();
mockManager.mockLabsEnabled('webmentions');
// TODO: test various users' access
await fixtureManager.init('users','mentions');
await agent.loginAsOwner();
@ -31,10 +30,4 @@ describe('Mentions API', function () {
mentions: new Array(2).fill(matchMentionShallowIncludes)
});
});
it('Cannot browse when lab disabled', async function () {
mockManager.mockLabsDisabled('webmentions');
await agent.get('mentions/')
.expectStatus(404);
});
});