diff --git a/core/server/api/v2/utils/serializers/output/utils/mapper.js b/core/server/api/v2/utils/serializers/output/utils/mapper.js index 7f0800e926..3880cc375e 100644 --- a/core/server/api/v2/utils/serializers/output/utils/mapper.js +++ b/core/server/api/v2/utils/serializers/output/utils/mapper.js @@ -32,9 +32,9 @@ const mapPost = (model, frame) => { if (utils.isContentAPI(frame)) { date.forPost(jsonModel); members.forPost(jsonModel, frame); - extraAttrs.forPost(frame, model, jsonModel); } + extraAttrs.forPost(frame, model, jsonModel); clean.post(jsonModel, frame); if (frame.options && frame.options.withRelated) { diff --git a/core/test/acceptance/old/admin/pages_spec.js b/core/test/acceptance/old/admin/pages_spec.js index 3594110d22..604a7c9c77 100644 --- a/core/test/acceptance/old/admin/pages_spec.js +++ b/core/test/acceptance/old/admin/pages_spec.js @@ -72,7 +72,10 @@ describe('Pages API', function () { .expect(201) .then((res) => { res.body.pages.length.should.eql(1); - localUtils.API.checkResponse(res.body.pages[0], 'page', null, ['primary_tag', 'primary_author']); + + // @NOTE: we do not return "excerpt" if custom_excerpt or plaintext is empty + // @NOTE: we do not return primary_* if null + localUtils.API.checkResponse(res.body.pages[0], 'page', null, ['primary_tag', 'primary_author', 'excerpt']); should.exist(res.headers['x-cache-invalidate']); return models.Post.findOne({ diff --git a/core/test/acceptance/old/admin/utils.js b/core/test/acceptance/old/admin/utils.js index de6202ec98..c26435b335 100644 --- a/core/test/acceptance/old/admin/utils.js +++ b/core/test/acceptance/old/admin/utils.js @@ -29,8 +29,10 @@ const expectedProperties = { .without('visibility') .without('locale') .without('page') - // always returns computed properties: url, comment_id, primary_tag, primary_author - .without('author_id').concat('url', 'primary_tag', 'primary_author') + // deprecated + .without('author_id') + // always returns computed properties + .concat('url', 'primary_tag', 'primary_author', 'excerpt') , page: _(schema.posts) @@ -40,8 +42,10 @@ const expectedProperties = { .without('visibility') .without('locale') .without('page') - // always returns computed properties: url, comment_id, primary_tag, primary_author - .without('author_id').concat('url', 'primary_tag', 'primary_author') + // deprecated + .without('author_id') + // always returns computed properties + .concat('url', 'primary_tag', 'primary_author', 'excerpt') , user: _(schema.users)