mirror of
https://github.com/snipe/snipe-it.git
synced 2024-12-24 05:04:07 -08:00
Merge pull request #2190 from dmeltzer/fix-asset-creation
Flash input on model validation errors when creating/editing assets.
This commit is contained in:
commit
70aefdc9c0
|
@ -254,6 +254,7 @@ class AssetsController extends Controller
|
||||||
\Session::flash('success', trans('admin/hardware/message.create.success'));
|
\Session::flash('success', trans('admin/hardware/message.create.success'));
|
||||||
return response()->json(['redirect_url' => route('hardware')]);
|
return response()->json(['redirect_url' => route('hardware')]);
|
||||||
}
|
}
|
||||||
|
\Input::flash();
|
||||||
\Session::flash('errors', $asset->getErrors());
|
\Session::flash('errors', $asset->getErrors());
|
||||||
return response()->json(['errors' => $asset->getErrors()], 500);
|
return response()->json(['errors' => $asset->getErrors()], 500);
|
||||||
}
|
}
|
||||||
|
@ -417,6 +418,7 @@ class AssetsController extends Controller
|
||||||
\Session::flash('success', trans('admin/hardware/message.update.success'));
|
\Session::flash('success', trans('admin/hardware/message.update.success'));
|
||||||
return response()->json(['redirect_url' => route("view/hardware", $assetId)]);
|
return response()->json(['redirect_url' => route("view/hardware", $assetId)]);
|
||||||
}
|
}
|
||||||
|
\Input::flash();
|
||||||
\Session::flash('errors', $asset->getErrors());
|
\Session::flash('errors', $asset->getErrors());
|
||||||
return response()->json(['errors' => $asset->getErrors()], 500);
|
return response()->json(['errors' => $asset->getErrors()], 500);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue