mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-11 05:47:28 -08:00
Merge pull request #2187 from dmeltzer/fix-asset-creation
Fix asset creation errors when asset tag already exists
This commit is contained in:
commit
71b82fee03
|
@ -254,8 +254,8 @@ 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')]);
|
||||||
}
|
}
|
||||||
|
\Session::flash('errors', $asset->getErrors());
|
||||||
return response()->json(['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'));
|
\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)]);
|
||||||
}
|
}
|
||||||
|
\Session::flash('errors', $asset->getErrors());
|
||||||
return response()->json(['errors' => $asset->getErrors()]);
|
return response()->json(['errors' => $asset->getErrors()], 500);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue