Skip to content

Commit

Permalink
Removed duplicate update method (per snipe#7997)
Browse files Browse the repository at this point in the history
Signed-off-by: snipe <snipe@snipe.net>
  • Loading branch information
snipe committed May 1, 2020
1 parent c346504 commit 82e0249
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions app/Http/Controllers/Api/DepartmentsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,28 +186,5 @@ public function selectlist(Request $request)
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()));
}

}

0 comments on commit 82e0249

Please sign in to comment.