diff --git a/app/Http/Controllers/CollectionController.php b/app/Http/Controllers/CollectionController.php index 46dcf4838..85f3f30cf 100644 --- a/app/Http/Controllers/CollectionController.php +++ b/app/Http/Controllers/CollectionController.php @@ -166,11 +166,7 @@ class CollectionController extends Controller 'order' => $count, ]); - CollectionService::addItem( - $collection->id, - $status->id, - $count - ); + CollectionService::deleteCollection($collection->id); $collection->updated_at = now(); $collection->save(); diff --git a/resources/assets/js/components/CollectionComponent.vue b/resources/assets/js/components/CollectionComponent.vue index 60510f559..ea5e21525 100644 --- a/resources/assets/js/components/CollectionComponent.vue +++ b/resources/assets/js/components/CollectionComponent.vue @@ -619,6 +619,9 @@ export default { this.posts = this.posts.filter(post => { return post.id != id; }); + this.ids = this.ids.filter(post_id => { + return post_id != id; + }); }, addRecentId(post) { @@ -630,6 +633,7 @@ export default { // window.location.reload(); this.closeModals(); this.posts.push(res.data); + this.ids.push(post.id); this.collection.post_count++; }).catch(err => { swal('Oops!', 'An error occured, please try selecting another post.', 'error');