CreateFolderStructureAction refactoring

This commit is contained in:
Čarodej
2022-01-25 10:55:48 +01:00
parent ec92295fbf
commit 5725753052
4 changed files with 141 additions and 70 deletions

View File

@@ -17,7 +17,7 @@ class UploadFileAction
public function __construct(
public RecordUploadAction $recordUpload,
public ProcessImageThumbnailAction $createImageThumbnail,
public CreateFolderStructureAction $createFolderStructure,
public GetFileParentId $getFileParentId,
public MoveFileToExternalStorageAction $moveFileToExternalStorage,
) {
}
@@ -94,7 +94,7 @@ class UploadFileAction
return UserFile::create([
'mimetype' => get_file_type_from_mimetype($file_mimetype),
'type' => get_file_type($file_mimetype),
'parent_id' => ($this->createFolderStructure)($request, $user->id),
'parent_id' => ($this->getFileParentId)($request, $user->id),
'metadata' => $metadata,
'name' => $request->input('filename'),
'basename' => $fileName,