mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-22 14:31:26 +00:00
Merge pull request #4792 from mbliznikova/4790_4791_add_recently_deleted_post_to_collection_no_page_reloading_invalidate_cache_after_adding
4790 4791 add recently deleted post to collection no page reloading invalidate cache after adding
This commit is contained in:
commit
6ffc964371
2 changed files with 5 additions and 5 deletions
|
@ -166,11 +166,7 @@ class CollectionController extends Controller
|
||||||
'order' => $count,
|
'order' => $count,
|
||||||
]);
|
]);
|
||||||
|
|
||||||
CollectionService::addItem(
|
CollectionService::deleteCollection($collection->id);
|
||||||
$collection->id,
|
|
||||||
$status->id,
|
|
||||||
$count
|
|
||||||
);
|
|
||||||
|
|
||||||
$collection->updated_at = now();
|
$collection->updated_at = now();
|
||||||
$collection->save();
|
$collection->save();
|
||||||
|
|
|
@ -619,6 +619,9 @@ export default {
|
||||||
this.posts = this.posts.filter(post => {
|
this.posts = this.posts.filter(post => {
|
||||||
return post.id != id;
|
return post.id != id;
|
||||||
});
|
});
|
||||||
|
this.ids = this.ids.filter(post_id => {
|
||||||
|
return post_id != id;
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
addRecentId(post) {
|
addRecentId(post) {
|
||||||
|
@ -630,6 +633,7 @@ export default {
|
||||||
// window.location.reload();
|
// window.location.reload();
|
||||||
this.closeModals();
|
this.closeModals();
|
||||||
this.posts.push(res.data);
|
this.posts.push(res.data);
|
||||||
|
this.ids.push(post.id);
|
||||||
this.collection.post_count++;
|
this.collection.post_count++;
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
swal('Oops!', 'An error occured, please try selecting another post.', 'error');
|
swal('Oops!', 'An error occured, please try selecting another post.', 'error');
|
||||||
|
|
Loading…
Reference in a new issue