mirror of
https://github.com/snipe/snipe-it.git
synced 2024-11-09 23:24:06 -08:00
Merge pull request #11147 from inietov/fixes/argument_passed_to_ItemImportRequest_is_null
FixesArgument 1 passed to App\Http\Requests\ItemImportRequest::import() must be an instance of App\Models\Import, null given
This commit is contained in:
commit
b426fa352e
|
@ -134,7 +134,14 @@ class ImportController extends Controller
|
|||
\Log::debug('NO BACKUP requested via importer');
|
||||
}
|
||||
|
||||
$errors = $request->import(Import::find($import_id));
|
||||
$import = Import::find($import_id);
|
||||
|
||||
if(is_null($import)){
|
||||
$error[0][0] = trans("validation.exists", ["attribute" => "file"]);
|
||||
return response()->json(Helper::formatStandardApiResponse('import-errors', null, $error), 500);
|
||||
}
|
||||
|
||||
$errors = $request->import($import);
|
||||
$redirectTo = 'hardware.index';
|
||||
switch ($request->get('import-type')) {
|
||||
case 'asset':
|
||||
|
|
Loading…
Reference in a new issue