diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-12-04 15:35:38 +0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-12-04 15:37:39 +0400 |
commit | 21f4e5d3ac80c319592ecedb8bbf0c162841beb7 (patch) | |
tree | b8eb1e801b3e96052ccaf2ccb7feb8cf443a807c /lib/api/project_hooks.rb | |
parent | 822dac87eccad5044e0e82fd671e8b71f21942a5 (diff) |
ProjectHook API supports new event fields
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'lib/api/project_hooks.rb')
-rw-r--r-- | lib/api/project_hooks.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/api/project_hooks.rb b/lib/api/project_hooks.rb index e5da15d3ea9..c271dd8b61b 100644 --- a/lib/api/project_hooks.rb +++ b/lib/api/project_hooks.rb @@ -47,8 +47,9 @@ module API # POST /projects/:id/hooks post ":id/hooks" do required_attributes! [:url] + attrs = attributes_for_keys [:url, :push_events, :issues_events, :merge_requests_events] + @hook = user_project.hooks.new(attrs) - @hook = user_project.hooks.new({"url" => params[:url]}) if @hook.save present @hook, with: Entities::ProjectHook else @@ -70,8 +71,8 @@ module API put ":id/hooks/:hook_id" do @hook = user_project.hooks.find(params[:hook_id]) required_attributes! [:url] + attrs = attributes_for_keys [:url, :push_events, :issues_events, :merge_requests_events] - attrs = attributes_for_keys [:url] if @hook.update_attributes attrs present @hook, with: Entities::ProjectHook else |