summaryrefslogtreecommitdiff
path: root/lib/api/group_export.rb
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-04-09 12:09:24 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-04-09 12:09:24 +0000
commita9ced7da447785c57477b3d8dbccc73a78cface1 (patch)
tree5179d27ab9d801748ee4ed1c64c985974e799812 /lib/api/group_export.rb
parentad0265eead72a624ce7a020847db4f0f0c877e57 (diff)
downloadgitlab-ce-a9ced7da447785c57477b3d8dbccc73a78cface1.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/api/group_export.rb')
-rw-r--r--lib/api/group_export.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/api/group_export.rb b/lib/api/group_export.rb
index 6fe72458da2..8ca5dfa082e 100644
--- a/lib/api/group_export.rb
+++ b/lib/api/group_export.rb
@@ -27,9 +27,13 @@ module API
detail 'This feature was introduced in GitLab 12.5.'
end
post ':id/export' do
- GroupExportWorker.perform_async(current_user.id, user_group.id, params) # rubocop:disable CodeReuse/Worker
+ export_service = ::Groups::ImportExport::ExportService.new(group: user_group, user: current_user)
- accepted!
+ if export_service.async_execute
+ accepted!
+ else
+ render_api_error!(message: 'Group export could not be started.')
+ end
end
end
end