2018-07-17 12:50:37 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-11-01 10:08:18 -04:00
|
|
|
module Projects
|
|
|
|
module GroupLinks
|
|
|
|
class DestroyService < BaseService
|
|
|
|
def execute(group_link)
|
|
|
|
return false unless group_link
|
2017-11-14 04:02:39 -05:00
|
|
|
|
2020-01-30 16:08:47 -05:00
|
|
|
if group_link.project.private?
|
|
|
|
TodosDestroyer::ProjectPrivateWorker.perform_in(Todo::WAIT_FOR_DELETE, project.id)
|
|
|
|
else
|
|
|
|
TodosDestroyer::ConfidentialIssueWorker.perform_in(Todo::WAIT_FOR_DELETE, nil, project.id)
|
|
|
|
end
|
|
|
|
|
2020-06-03 02:08:34 -04:00
|
|
|
group_link.destroy.tap do |link|
|
|
|
|
link.group.refresh_members_authorized_projects
|
|
|
|
end
|
2017-11-01 10:08:18 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2019-09-13 09:26:31 -04:00
|
|
|
|
|
|
|
Projects::GroupLinks::DestroyService.prepend_if_ee('EE::Projects::GroupLinks::DestroyService')
|