mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05:00
Revert latest change
This commit is contained in:
parent
90966a919a
commit
3b31102347
1 changed files with 16 additions and 22 deletions
|
@ -288,32 +288,26 @@ export default class PostsContextMenu extends Component {
|
|||
@task
|
||||
*unschedulePostsTask() {
|
||||
const updatedModels = this.selectionList.availableModels;
|
||||
try {
|
||||
// Perform the bulk edit action to unschedule the posts
|
||||
yield this.performBulkEdit('unschedule');
|
||||
this.notifications.showNotification(this.#getToastMessage('unscheduled'), {type: 'success'});
|
||||
yield this.performBulkEdit('unschedule');
|
||||
this.notifications.showNotification(this.#getToastMessage('unscheduled'), {type: 'success'});
|
||||
|
||||
// Update the models on the client side
|
||||
for (const post of updatedModels) {
|
||||
if (post.status === 'scheduled') {
|
||||
// We need to do it this way to prevent marking the model as dirty
|
||||
this.store.push({
|
||||
data: {
|
||||
id: post.id,
|
||||
type: this.type,
|
||||
attributes: {
|
||||
status: 'draft'
|
||||
}
|
||||
// Update the models on the client side
|
||||
for (const post of updatedModels) {
|
||||
if (post.status === 'scheduled') {
|
||||
// We need to do it this way to prevent marking the model as dirty
|
||||
this.store.push({
|
||||
data: {
|
||||
id: post.id,
|
||||
type: this.type,
|
||||
attributes: {
|
||||
status: 'draft'
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Remove posts that no longer match the filter
|
||||
this.updateFilteredPosts();
|
||||
} catch (error) {
|
||||
this.notifications.showAPIError(error, {key: `${this.type}.unschedule.failed`});
|
||||
}
|
||||
|
||||
this.updateFilteredPosts();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue