feature: job exporting (resolves #155)

This commit is contained in:
Gary Sharp
2024-12-12 16:02:12 +11:00
parent 90c709c4c1
commit a6b9cd1af2
55 changed files with 3197 additions and 412 deletions
@@ -449,6 +449,9 @@ namespace Disco.Web.Areas.API.Controllers
if (context.Result == null || context.Result.Result == null)
throw new ArgumentException("The export session is still running, or failed to complete successfully", nameof(Id));
if (context.Result.RecordCount == 0)
throw new ArgumentException("No records were found to export", nameof(Id));
var fileStream = context.Result.Result;
return this.File(fileStream.GetBuffer(), 0, (int)fileStream.Length, context.Result.MimeType, context.Result.Filename);