0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-17 23:44:39 -05:00

Fixed published post count shown on publish complete step

no issue

- API query was using `?status=published` instead of `?filter=status:published` so was counting all posts rather than just published ones
This commit is contained in:
Kevin Ansfield 2022-05-18 18:01:28 +01:00
parent 9019ae783c
commit f2b9fa544f

View file

@ -73,10 +73,11 @@ export default class PublishModalComponent extends Component {
// no count is shown for pages, scheduled posts, or email-only posts
if (publishOptions.post.isPage || publishOptions.isScheduled || !publishOptions.willPublish) {
this.postCount = null;
return;
}
const result = yield this.store.query('post', {status: 'published', limit: 1});
const result = yield this.store.query('post', {filter: 'status:published', limit: 1});
let count = result.meta.pagination.total;
count += 1; // account for the new post