public function __construct(
protected BaseRepo $baseRepo,
protected EntityQueries $entityQueries,
+ protected TrashCan $trashCan,
) {
}
$this->baseRepo->updateDefaultTemplate($chapter, intval($input['default_template_id'] ?? null));
Activity::add(ActivityType::CHAPTER_CREATE, $chapter);
+ $this->baseRepo->sortParent($chapter);
+
return $chapter;
}
Activity::add(ActivityType::CHAPTER_UPDATE, $chapter);
+ $this->baseRepo->sortParent($chapter);
+
return $chapter;
}
*/
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();
}
/**
$chapter->rebuildPermissions();
Activity::add(ActivityType::CHAPTER_MOVE, $chapter);
+ $this->baseRepo->sortParent($chapter);
+
return $parent;
}
}