Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'lib/api/issue_links.rb')
-rw-r--r--lib/api/issue_links.rb6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/api/issue_links.rb b/lib/api/issue_links.rb
index 020b02248a0..4c79aa2587f 100644
--- a/lib/api/issue_links.rb
+++ b/lib/api/issue_links.rb
@@ -55,7 +55,7 @@ module API
requires :target_project_id, types: [String, Integer],
desc: 'The ID or URL-encoded path of a target project'
requires :target_issue_iid, types: [String, Integer], desc: 'The internal ID of a target project’s issue'
- optional :link_type, type: String, values: IssueLink.link_types.keys,
+ optional :link_type, type: String, values: IssueLink.available_link_types,
desc: 'The type of the relation (“relates_to”, “blocks”, “is_blocked_by”),'\
'defaults to “relates_to”)'
end
@@ -72,9 +72,7 @@ module API
.execute
if result[:status] == :success
- issue_link = IssueLink.find_by!(source: source_issue, target: target_issue)
-
- present issue_link, with: Entities::IssueLink
+ present result[:created_references].first, with: Entities::IssueLink
else
render_api_error!(result[:message], result[:http_status])
end