diff --git a/lib/api/v3/projects/available_work_packages_api.rb b/lib/api/v3/projects/available_work_packages_api.rb index be03771eae..9cd00f24c1 100644 --- a/lib/api/v3/projects/available_work_packages_api.rb +++ b/lib/api/v3/projects/available_work_packages_api.rb @@ -61,7 +61,7 @@ module API @work_package.reload WorkPackages::WorkPackageRepresenter.create(@work_package, - current_user: current_user) + current_user: current_user) else errors = ::API::Errors::ErrorBase.create(@work_package.errors.dup) @work_package.destroy diff --git a/lib/api/v3/projects/project_representer.rb b/lib/api/v3/projects/project_representer.rb index d5ba06e185..07fefb2b59 100644 --- a/lib/api/v3/projects/project_representer.rb +++ b/lib/api/v3/projects/project_representer.rb @@ -37,7 +37,7 @@ module API self_link - link :createWorkPackage do + link :createWorkPackage do { href: api_v3_paths.create_work_package_form(represented.id), method: :post diff --git a/lib/api/v3/work_packages/schema/work_package_schema_representer.rb b/lib/api/v3/work_packages/schema/work_package_schema_representer.rb index c1d7bc93c5..48ecccd5c5 100644 --- a/lib/api/v3/work_packages/schema/work_package_schema_representer.rb +++ b/lib/api/v3/work_packages/schema/work_package_schema_representer.rb @@ -94,8 +94,9 @@ module API schema :spent_time, type: 'Duration', writable: false, - show_if: -> (_) { current_user_allowed_to(:view_time_entries, - context: represented.project) } + show_if: -> (_) { + current_user_allowed_to(:view_time_entries, context: represented.project) + } schema :percentage_done, type: 'Integer', diff --git a/lib/api/v3/work_packages/work_package_representer.rb b/lib/api/v3/work_packages/work_package_representer.rb index 49e9ab9ac2..4c553c5997 100644 --- a/lib/api/v3/work_packages/work_package_representer.rb +++ b/lib/api/v3/work_packages/work_package_representer.rb @@ -254,8 +254,9 @@ module API datetime_formatter.format_duration_from_hours(represented.spent_hours) end, writeable: false, - if: -> (_) { current_user_allowed_to(:view_time_entries, - context: represented.project) } + if: -> (_) { + current_user_allowed_to(:view_time_entries, context: represented.project) + } property :done_ratio, as: :percentageDone, render_nil: true, @@ -278,8 +279,10 @@ module API property :watchers, embedded: true, exec_context: :decorator, - if: -> (*) { current_user_allowed_to(:view_work_package_watchers, - context: represented.project) } + if: -> (*) { + current_user_allowed_to(:view_work_package_watchers, + context: represented.project) + } property :attachments, embedded: true, diff --git a/lib/api/v3/work_packages/work_packages_shared_helpers.rb b/lib/api/v3/work_packages/work_packages_shared_helpers.rb index 0722f0062c..7e08df41ed 100644 --- a/lib/api/v3/work_packages/work_packages_shared_helpers.rb +++ b/lib/api/v3/work_packages/work_packages_shared_helpers.rb @@ -81,7 +81,6 @@ module API false end end - end end end