X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/193d7fb3fe71a76a43ebc1ccdb617b4b627d1e09..refs/pull/3391/head:/app/Entities/Repos/BaseRepo.php diff --git a/app/Entities/Repos/BaseRepo.php b/app/Entities/Repos/BaseRepo.php index 569918503..9e1b41672 100644 --- a/app/Entities/Repos/BaseRepo.php +++ b/app/Entities/Repos/BaseRepo.php @@ -11,8 +11,8 @@ use Illuminate\Http\UploadedFile; class BaseRepo { - protected $tagRepo; - protected $imageRepo; + protected TagRepo $tagRepo; + protected ImageRepo $imageRepo; public function __construct(TagRepo $tagRepo, ImageRepo $imageRepo) { @@ -58,6 +58,7 @@ class BaseRepo if (isset($input['tags'])) { $this->tagRepo->saveTagsToEntity($entity, $input['tags']); + $entity->touch(); } $entity->rebuildPermissions(); @@ -67,10 +68,12 @@ class BaseRepo /** * Update the given items' cover image, or clear it. * + * @param Entity&HasCoverImage $entity + * * @throws ImageUploadException * @throws \Exception */ - public function updateCoverImage(HasCoverImage $entity, ?UploadedFile $coverImage, bool $removeImage = false) + public function updateCoverImage($entity, ?UploadedFile $coverImage, bool $removeImage = false) { if ($coverImage) { $this->imageRepo->destroyImage($entity->cover);