simplify media deletion
This commit is contained in:
parent
247433bc60
commit
01434a9b2d
4 changed files with 34 additions and 15 deletions
|
|
@ -10,8 +10,6 @@ use App\Shared\Files\FileUploader;
|
|||
|
||||
class UpdatePdfPath
|
||||
{
|
||||
private const MANAGED_FOLDER_PREFIX = 'element-pdfs/';
|
||||
|
||||
public function __construct(
|
||||
private ElementRepository $elementRepository,
|
||||
private FileUploader $fileUploader,
|
||||
|
|
@ -62,10 +60,6 @@ class UpdatePdfPath
|
|||
return;
|
||||
}
|
||||
|
||||
if (! str_starts_with($path, self::MANAGED_FOLDER_PREFIX)) {
|
||||
return;
|
||||
}
|
||||
|
||||
$this->fileUploader->delete($path);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue