diff options
author | Francisco Javier López <fjlopez@gitlab.com> | 2017-11-01 17:08:18 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2017-11-01 17:08:18 +0300 |
commit | af1fb493235496cc676795f0e7d355bfb34f869b (patch) | |
tree | 5cd99f98938d3bba32b0994be3eef9e41d03af74 /app/services/projects/group_links | |
parent | 713052c7255c9c4fc33b74ca5d788644a30018ca (diff) |
Refactor/group links controller
Diffstat (limited to 'app/services/projects/group_links')
-rw-r--r-- | app/services/projects/group_links/create_service.rb | 15 | ||||
-rw-r--r-- | app/services/projects/group_links/destroy_service.rb | 10 |
2 files changed, 25 insertions, 0 deletions
diff --git a/app/services/projects/group_links/create_service.rb b/app/services/projects/group_links/create_service.rb new file mode 100644 index 00000000000..35624577024 --- /dev/null +++ b/app/services/projects/group_links/create_service.rb @@ -0,0 +1,15 @@ +module Projects + module GroupLinks + class CreateService < BaseService + def execute(group) + return false unless group + + project.project_group_links.create( + group: group, + group_access: params[:link_group_access], + expires_at: params[:expires_at] + ) + end + end + end +end diff --git a/app/services/projects/group_links/destroy_service.rb b/app/services/projects/group_links/destroy_service.rb new file mode 100644 index 00000000000..fbf31214c28 --- /dev/null +++ b/app/services/projects/group_links/destroy_service.rb @@ -0,0 +1,10 @@ +module Projects + module GroupLinks + class DestroyService < BaseService + def execute(group_link) + return false unless group_link + group_link.destroy + end + end + end +end |