Merge pull request #2187 from dmeltzer/fix-asset-creation

Fix asset creation errors when asset tag already exists
This commit is contained in:
snipe 2016-06-22 11:31:48 -07:00 committed by GitHub
commit 71b82fee03

View file

@ -254,8 +254,8 @@ class AssetsController extends Controller
\Session::flash('success', trans('admin/hardware/message.create.success'));
return response()->json(['redirect_url' => route('hardware')]);
}
return response()->json(['errors' => $asset->getErrors()]);
\Session::flash('errors', $asset->getErrors());
return response()->json(['errors' => $asset->getErrors()], 500);
}
/**
@ -417,8 +417,8 @@ class AssetsController extends Controller
\Session::flash('success', trans('admin/hardware/message.update.success'));
return response()->json(['redirect_url' => route("view/hardware", $assetId)]);
}
return response()->json(['errors' => $asset->getErrors()]);
\Session::flash('errors', $asset->getErrors());
return response()->json(['errors' => $asset->getErrors()], 500);
}