mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-21 03:15:45 -08:00
Removed duplicate update method (per #7997)
Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
parent
c34650458f
commit
82e02490fd
|
@ -186,28 +186,5 @@ class DepartmentsController extends Controller
|
|||
return (new SelectlistTransformer)->transformSelectlist($departments);
|
||||
|
||||
}
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @author [Godfrey Martinez] [<gmartinez@grokability.com>]
|
||||
* @since [v4.0]
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
$this->authorize('update', Department::class);
|
||||
$departments = Department::findOrFail($id);
|
||||
$departments->fill($request->all());
|
||||
|
||||
if ($departments->save()) {
|
||||
return response()
|
||||
->json(Helper::formatStandardApiResponse('success', (new DepartmentsTransformer())->transformdepartment($departments), trans('admin/departments/message.update.success')));
|
||||
}
|
||||
|
||||
return response()
|
||||
->json(Helper::formatStandardApiResponse('error', null, $departments->getErrors()));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue