diff options
Diffstat (limited to 'lib/api/group_export.rb')
-rw-r--r-- | lib/api/group_export.rb | 8 |
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 |