fix(file): fixed name error when edit file
This commit is contained in:
parent
e1fc79e50e
commit
cc61e69dfe
1 changed files with 6 additions and 2 deletions
|
@ -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'];
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue