diff --git a/backend/src/Designer/Controllers/OptionsController.cs b/backend/src/Designer/Controllers/OptionsController.cs index 6211e9ffa30..cf1d2d45aaa 100644 --- a/backend/src/Designer/Controllers/OptionsController.cs +++ b/backend/src/Designer/Controllers/OptionsController.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.Text.Json; using System.Threading; using System.Threading.Tasks; using Altinn.Studio.Designer.Helpers; @@ -128,6 +129,32 @@ public async Task CreateOrOverwriteOptionsList(string org, string return Ok(newOptionsList); } + /// + /// Create new options list. + /// + /// Unique identifier of the organisation responsible for the app. + /// Application identifier which is unique within an organisation. + /// File being uploaded. + /// that observes if operation is cancelled. + [HttpPost] + [Route("upload")] + public async Task UploadFile(string org, string repo, [FromForm] IFormFile file, CancellationToken cancellationToken) + { + cancellationToken.ThrowIfCancellationRequested(); + string developer = AuthenticationHelper.GetDeveloperUserName(HttpContext); + string fileName = file.FileName.Replace(".json", ""); + + try + { + List