This commit is contained in:
@@ -43,7 +43,7 @@ namespace AyaNova.Api.Controllers
|
||||
/// Upload and import file
|
||||
/// Max 100mb total
|
||||
/// </summary>
|
||||
/// <returns>Accepted</returns>
|
||||
/// <returns>Results</returns>
|
||||
[Authorize]
|
||||
[HttpPost("upload")]
|
||||
[DisableFormValueModelBinding]
|
||||
@@ -58,6 +58,7 @@ namespace AyaNova.Api.Controllers
|
||||
|
||||
// AyaTypeId attachToObject = null;
|
||||
ApiUploadProcessor.ApiUploadedFilesResult uploadFormData = null;
|
||||
List<string> ImportResult=new List<string>();
|
||||
try
|
||||
{
|
||||
if (!MultipartRequestHelper.IsMultipartContentType(Request.ContentType))
|
||||
@@ -103,7 +104,7 @@ namespace AyaNova.Api.Controllers
|
||||
foreach (UploadedFileInfo a in uploadFormData.UploadedFiles)
|
||||
{
|
||||
JArray ja = JArray.Parse(System.IO.File.ReadAllText(a.InitialUploadedPathName));
|
||||
await ((IImportAbleObject)biz).ImportData(ja);
|
||||
ImportResult.AddRange(await ((IImportAbleObject)biz).ImportData(ja));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -119,7 +120,7 @@ namespace AyaNova.Api.Controllers
|
||||
}
|
||||
|
||||
//TODO: Return results of operation here
|
||||
return Accepted();
|
||||
return Ok(ImportResult);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user