mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-25 03:44:29 +03:00
Fixed unpublishing sent posts was allowed
refs https://github.com/TryGhost/Team/issues/2677
This commit is contained in:
parent
82393fa99d
commit
76fae2a724
@ -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;
|
||||
}
|
||||
}
|
||||
|
@ -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});
|
||||
|
Loading…
Reference in New Issue
Block a user