From 600e949880d5dae9d4efb12e7ce41e05ff168db5 Mon Sep 17 00:00:00 2001 From: Wieland Lindenthal Date: Mon, 8 Oct 2018 13:02:59 +0200 Subject: [PATCH] Fix #28639. Use api_v3_path helpers for linking work package's available relation candidates --- lib/api/v3/utilities/path_helper.rb | 4 ++++ lib/api/v3/work_packages/work_package_representer.rb | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/api/v3/utilities/path_helper.rb b/lib/api/v3/utilities/path_helper.rb index c83feaaf70..4682244222 100644 --- a/lib/api/v3/utilities/path_helper.rb +++ b/lib/api/v3/utilities/path_helper.rb @@ -406,6 +406,10 @@ module API "#{work_package_relations(work_package_id)}/#{id}" end + def self.work_package_available_relation_candidates(id) + "#{work_package(id)}/available_relation_candidates" + end + def self.work_package_revisions(id) "#{work_package(id)}/revisions" end diff --git a/lib/api/v3/work_packages/work_package_representer.rb b/lib/api/v3/work_packages/work_package_representer.rb index 6e9b62c3f7..0c352e810b 100644 --- a/lib/api/v3/work_packages/work_package_representer.rb +++ b/lib/api/v3/work_packages/work_package_representer.rb @@ -138,7 +138,7 @@ module API next if represented.new_record? { - href: "/api/v3/work_packages/#{represented.id}/available_relation_candidates", + href: api_v3_paths.work_package_available_relation_candidates(represented.id), title: "Potential work packages to relate to" } end