/** * Updates the department settings. * Only administrators can access this method. * * @ApiDoc( * description="Updates department settings", * section="Settings", * requirements={ * {"name"="organization", "dataType"="integer", "requirement"="\d+", "description"="organization id"}, * {"name"="department", "dataType"="integer", "requirement"="\d+", "description"="department id"} * }, * statusCodes={ * 204="Returned when the settings were successfully updated.", * 401="Returned when the user is not an administrator.", * 404={ * "Returned when the organization was not found.", * "Returned when the department was not found." * } * } * ) * * @Rest\View() * @Security("has_role('ROLE_ADMIN')") */ public function postAction(Request $request, Organization $organization, Organization $department) { return $this->get('settings.helpers')->processForm($request, $department->getSettings()); }