fix(file): fixed name error when edit file

This commit is contained in:
Marco Cavalli 2025-03-13 10:31:04 +01:00
parent e1fc79e50e
commit cc61e69dfe

View file

@ -110,10 +110,14 @@ class FileController extends Controller
* @return mixed
*/
public function update(Request $request, $id) {
// return json_encode(['req' => $request->all(),'id' => $id]);
$file = File::whereId($id)->first();
$fields = $request->all();
//$fields['length'] = new LengthFormatter($fields['length']);
if (is_null($fields['name'])) {
unset($fields['name']);
}
//Only from Analyzer
if (isset($fields['full_path'])) {
$fields['filepath'] = $fields['full_path'];
}