mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-18 02:21:47 -05:00
Added attribution counts to Pages API (#15289)
fixes https://github.com/TryGhost/Team/issues/1835 This was missed in the initial pass when adding to the Posts API
This commit is contained in:
parent
0695f74a65
commit
d91d6c1311
3 changed files with 4 additions and 2 deletions
|
@ -2,7 +2,7 @@ const models = require('../../models');
|
|||
const tpl = require('@tryghost/tpl');
|
||||
const errors = require('@tryghost/errors');
|
||||
const getPostServiceInstance = require('../../services/posts/posts-service');
|
||||
const ALLOWED_INCLUDES = ['tags', 'authors', 'authors.roles', 'tiers'];
|
||||
const ALLOWED_INCLUDES = ['tags', 'authors', 'authors.roles', 'tiers', 'count.signups', 'count.conversions'];
|
||||
const UNSAFE_ATTRS = ['status', 'authors', 'visibility'];
|
||||
|
||||
const messages = {
|
||||
|
|
|
@ -23,7 +23,7 @@ function defaultRelations(frame) {
|
|||
return false;
|
||||
}
|
||||
|
||||
frame.options.withRelated = ['tags', 'authors', 'authors.roles', 'tiers'];
|
||||
frame.options.withRelated = ['tags', 'authors', 'authors.roles', 'tiers', 'count.signups', 'count.conversions'];
|
||||
}
|
||||
|
||||
function setDefaultOrder(frame) {
|
||||
|
|
|
@ -6,6 +6,7 @@ const testUtils = require('../../utils');
|
|||
const config = require('../../../core/shared/config');
|
||||
const models = require('../../../core/server/models');
|
||||
const localUtils = require('./utils');
|
||||
const mockManager = require('../../utils/e2e-framework-mock-manager');
|
||||
|
||||
describe('Pages API', function () {
|
||||
let request;
|
||||
|
@ -14,6 +15,7 @@ describe('Pages API', function () {
|
|||
await localUtils.startGhost();
|
||||
request = supertest.agent(config.get('url'));
|
||||
await localUtils.doAuth(request, 'users:extra', 'posts');
|
||||
mockManager.mockLabsDisabled('memberAttribution');
|
||||
});
|
||||
|
||||
it('Can retrieve all pages', async function () {
|
||||
|
|
Loading…
Add table
Reference in a new issue