Skip to content

Commit

Permalink
file repo fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelfolaron committed Apr 30, 2024
1 parent df3cef4 commit 5a0a3fd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
1 change: 0 additions & 1 deletion .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 4 additions & 5 deletions app/Domain/Files/Repositories/Files.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Illuminate\Contracts\Container\BindingResolutionException;
use Leantime\Core\Db as DbCore;
use Leantime\Core\Fileupload as FileuploadCore;
use Leantime\Core\Fileupload;
use Leantime\Domain\Users\Repositories\Users as UserRepo;
use PDO;

Expand Down Expand Up @@ -257,7 +257,7 @@ public function deleteFile($id): bool
* @return array|false
* @throws BindingResolutionException
*/
public function upload($file, $module, $moduleId): false|array
public function upload($file, $module, $moduleId): false|string|array
{

//Clean module mess
Expand All @@ -268,7 +268,7 @@ public function upload($file, $module, $moduleId): false|array
$module = "ticket";
}

$upload = app()->make(FileuploadCore::class);
$upload = app()->make(Fileupload::class);

$path = $file['file']['name'];
$ext = pathinfo($path, PATHINFO_EXTENSION);
Expand Down Expand Up @@ -303,9 +303,8 @@ public function upload($file, $module, $moduleId): false|array
$return = false;
}
} else {

error_log($upload->error);
return false;
return $upload->error;
}
}

Expand Down
2 changes: 1 addition & 1 deletion app/Plugins

0 comments on commit 5a0a3fd

Please sign in to comment.