Fix restore assets

This commit is contained in:
snipe 2016-04-21 21:01:57 -07:00
parent 6b982ec253
commit 44f7305e12

View file

@ -911,14 +911,9 @@ class AssetsController extends Controller
return Redirect::to('hardware')->with('error', trans('general.insufficient_permissions')); return Redirect::to('hardware')->with('error', trans('general.insufficient_permissions'));
} elseif (isset($asset->id)) { } elseif (isset($asset->id)) {
// Restore the user // Restore the asset
$asset->restore(); Asset::withTrashed()->where('id',$assetId)->restore();
return Redirect::route('hardware')->with('success', trans('admin/hardware/message.restore.success'));
// Prepare the success message
$success = trans('admin/hardware/message.restore.success');
// Redirect to the user management page
return Redirect::route('hardware')->with('success', $success);
} else { } else {
return Redirect::to('hardware')->with('error', trans('admin/hardware/message.does_not_exist')); return Redirect::to('hardware')->with('error', trans('admin/hardware/message.does_not_exist'));