Fixed unpublishing sent posts was allowed

refs https://github.com/TryGhost/Team/issues/2677
This commit is contained in:
Simon Backx 2023-04-13 16:20:58 +02:00
parent 82393fa99d
commit 76fae2a724
2 changed files with 3 additions and 3 deletions

View File

@ -169,7 +169,7 @@ export default class PostsContextMenu extends Component {
// Update the models on the client side
for (const post of updatedModels) {
if (post.status === 'published' || post.status === 'sent') {
if (post.status === 'published') {
// We need to do it this way to prevent marking the model as dirty
this.store.push({
data: {
@ -329,7 +329,7 @@ export default class PostsContextMenu extends Component {
get canUnpublishSelection() {
for (const m of this.selectionList.availableModels) {
if (['published', 'sent'].includes(m.status)) {
if (m.status === 'published') {
return true;
}
}

View File

@ -69,7 +69,7 @@ class PostsService {
async bulkEdit(data, options) {
if (data.action === 'unpublish') {
return await this.#updatePosts({status: 'draft'}, {filter: this.#mergeFilters('status:[published,sent]', options.filter)});
return await this.#updatePosts({status: 'draft'}, {filter: this.#mergeFilters('status:published', options.filter)});
}
if (data.action === 'feature') {
return await this.#updatePosts({featured: true}, {filter: options.filter});