diff --git a/lib/api/v3/users/user_representer.rb b/lib/api/v3/users/user_representer.rb index da1fc4477f..cfb5cccee4 100644 --- a/lib/api/v3/users/user_representer.rb +++ b/lib/api/v3/users/user_representer.rb @@ -57,7 +57,7 @@ module API link :removeWatcher do { - href: "#{root_path}/api/v3/work_packages/#{@work_package.id}/watchers/#{represented.model.id}", + href: "#{root_path}api/v3/work_packages/#{@work_package.id}/watchers/#{represented.model.id}", method: :delete, title: 'Remove watcher' } if @work_package && current_user_allowed_to(:delete_work_package_watchers, @work_package) diff --git a/lib/api/v3/work_packages/work_package_representer.rb b/lib/api/v3/work_packages/work_package_representer.rb index 7cbb00b45a..6d24aec34a 100644 --- a/lib/api/v3/work_packages/work_package_representer.rb +++ b/lib/api/v3/work_packages/work_package_representer.rb @@ -58,7 +58,7 @@ module API link :update do { - href: "/api/v3/work_packages/#{represented.model.id}", + href: "#{root_path}api/v3/work_packages/#{represented.model.id}", method: :patch, title: "Update #{represented.subject}" } if current_user_allowed_to(:edit_work_packages, represented.model) @@ -130,7 +130,7 @@ module API link :addRelation do { - href: "#{root_path}/api/v3/work_packages/#{represented.model.id}/relations", + href: "#{root_path}api/v3/work_packages/#{represented.model.id}/relations", method: :post, title: 'Add relation' } if current_user_allowed_to(:manage_work_package_relations, represented.model) @@ -146,14 +146,14 @@ module API link :parent do { - href: "#{root_path}/api/v3/work_packages/#{represented.model.parent.id}", + href: "#{root_path}api/v3/work_packages/#{represented.model.parent.id}", title: represented.model.parent.subject } unless represented.model.parent.nil? || !represented.model.parent.visible? end links :children do visible_children.map do |child| - { href: "#{root_path}/api/v3/work_packages/#{child.id}", title: child.subject } + { href: "#{root_path}api/v3/work_packages/#{child.id}", title: child.subject } end unless visible_children.empty? end