From 82e02490fda8c2f8f3105aeeedb1b41e1a832fd1 Mon Sep 17 00:00:00 2001 From: snipe Date: Thu, 30 Apr 2020 17:23:56 -0700 Subject: [PATCH] Removed duplicate update method (per #7997) Signed-off-by: snipe --- .../Controllers/Api/DepartmentsController.php | 23 ------------------- 1 file changed, 23 deletions(-) diff --git a/app/Http/Controllers/Api/DepartmentsController.php b/app/Http/Controllers/Api/DepartmentsController.php index fe5c2e53d64a..b692d378b78e 100644 --- a/app/Http/Controllers/Api/DepartmentsController.php +++ b/app/Http/Controllers/Api/DepartmentsController.php @@ -186,28 +186,5 @@ public function selectlist(Request $request) return (new SelectlistTransformer)->transformSelectlist($departments); } - /** - * Update the specified resource in storage. - * - * @author [Godfrey Martinez] [] - * @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())); - } }