0
Fork 0
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:
Daniël van der Winden 2024-09-02 12:27:11 +02:00
parent 90966a919a
commit 3b31102347

View file

@ -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;
}