diff options
author | James Lopez <james@jameslopez.es> | 2018-06-25 16:10:26 +0300 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2018-07-06 16:46:18 +0300 |
commit | a2bf1641546a1d3eeb3e9f44734854f655c0adef (patch) | |
tree | 0652c20a92513330aa09c4a2ec9adbfaeb3a6494 /lib/api | |
parent | b0fa01fce3822da94aee6264829841996beb6df3 (diff) |
Update Import/Export to use object storage (based on aa feature flag)
Diffstat (limited to 'lib/api')
-rw-r--r-- | lib/api/project_export.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/api/project_export.rb b/lib/api/project_export.rb index 5ef4e9d530c..15c57a2fc02 100644 --- a/lib/api/project_export.rb +++ b/lib/api/project_export.rb @@ -23,9 +23,13 @@ module API get ':id/export/download' do path = user_project.export_project_path - render_api_error!('404 Not found or has expired', 404) unless path - - present_disk_file!(path, File.basename(path), 'application/gzip') + if path + present_disk_file!(path, File.basename(path), 'application/gzip') + elsif user_project.export_project_object_exists? + present_carrierwave_file!(user_project.import_export_upload.export_file) + else + render_api_error!('404 Not found or has expired', 404) + end end desc 'Start export' do |