X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/8e78b4c43eb980f47d9c207a0ce3330699d54103..refs/pull/5293/head:/app/Entities/Repos/ChapterRepo.php diff --git a/app/Entities/Repos/ChapterRepo.php b/app/Entities/Repos/ChapterRepo.php index cacca93f6..17cbccd41 100644 --- a/app/Entities/Repos/ChapterRepo.php +++ b/app/Entities/Repos/ChapterRepo.php @@ -18,6 +18,7 @@ class ChapterRepo public function __construct( protected BaseRepo $baseRepo, protected EntityQueries $entityQueries, + protected TrashCan $trashCan, ) { } @@ -59,10 +60,9 @@ class ChapterRepo */ public function destroy(Chapter $chapter) { - $trashCan = new TrashCan(); - $trashCan->softDestroyChapter($chapter); + $this->trashCan->softDestroyChapter($chapter); Activity::add(ActivityType::CHAPTER_DELETE, $chapter); - $trashCan->autoClearOld(); + $this->trashCan->autoClearOld(); } /**