diff options
author | Timothy Andrew <mail@timothyandrew.net> | 2017-02-28 13:59:14 +0530 |
---|---|---|
committer | Timothy Andrew <mail@timothyandrew.net> | 2017-03-07 13:55:59 +0530 |
commit | 9ccd8b8755d8c99a1c519d7251e7373df9812513 (patch) | |
tree | 3fcc3af0b9eb90b637a980d8bd9c87d14bba93f1 /lib/api/todos.rb | |
parent | 70584e6925698f9d5be335059f90f63a51821089 (diff) | |
download | gitlab-ce-9ccd8b8755d8c99a1c519d7251e7373df9812513.tar.gz |
Migrate the Todos API to use `issuable_iid`
- Instead of `issuable_id`
Diffstat (limited to 'lib/api/todos.rb')
-rw-r--r-- | lib/api/todos.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/api/todos.rb b/lib/api/todos.rb index e59030428da..d9b8837a5bb 100644 --- a/lib/api/todos.rb +++ b/lib/api/todos.rb @@ -5,8 +5,8 @@ module API before { authenticate! } ISSUABLE_TYPES = { - 'merge_requests' => ->(id) { find_merge_request_with_access(id) }, - 'issues' => ->(id) { find_project_issue(id) } + 'merge_requests' => ->(iid) { find_merge_request_with_access(iid) }, + 'issues' => ->(iid) { find_project_issue(iid) } }.freeze params do @@ -14,13 +14,13 @@ module API end resource :projects do ISSUABLE_TYPES.each do |type, finder| - type_id_str = "#{type.singularize}_id".to_sym + type_id_str = "#{type.singularize}_iid".to_sym desc 'Create a todo on an issuable' do success Entities::Todo end params do - requires type_id_str, type: Integer, desc: 'The ID of an issuable' + requires type_id_str, type: Integer, desc: 'The IID of an issuable' end post ":id/#{type}/:#{type_id_str}/todo" do issuable = instance_exec(params[type_id_str], &finder) |