This commit is contained in:
@@ -58,7 +58,8 @@ namespace AyaNova.Api.Controllers
|
||||
|
||||
// AyaTypeId attachToObject = null;
|
||||
ApiUploadProcessor.ApiUploadedFilesResult uploadFormData = null;
|
||||
List<string> ImportResult=new List<string>();
|
||||
List<string> ImportResult = new List<string>();
|
||||
ImportResult.Add("Import results\n");
|
||||
try
|
||||
{
|
||||
if (!MultipartRequestHelper.IsMultipartContentType(Request.ContentType))
|
||||
@@ -104,7 +105,7 @@ namespace AyaNova.Api.Controllers
|
||||
foreach (UploadedFileInfo a in uploadFormData.UploadedFiles)
|
||||
{
|
||||
JArray ja = JArray.Parse(System.IO.File.ReadAllText(a.InitialUploadedPathName));
|
||||
ImportResult.AddRange(await ((IImportAbleObject)biz).ImportData(ja));
|
||||
ImportResult.AddRange(await ((IImportAbleObject)biz).ImportData(ja));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -119,8 +120,7 @@ namespace AyaNova.Api.Controllers
|
||||
ApiUploadProcessor.DeleteTempUploadFile(uploadFormData);
|
||||
}
|
||||
|
||||
//TODO: Return results of operation here
|
||||
return Ok(ImportResult);
|
||||
return Ok(ApiOkResponse.Response(ImportResult));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@ using AyaNova.Models;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace AyaNova.Biz
|
||||
{
|
||||
@@ -344,14 +343,16 @@ namespace AyaNova.Biz
|
||||
var res = await CreateAsync(w);
|
||||
if (res == null)
|
||||
{
|
||||
ImportResult.Add($"{w.Name} - no {this.GetErrorsAsString()}");
|
||||
ImportResult.Add($"{w.Name} - {this.GetErrorsAsString()}");
|
||||
this.ClearErrors();
|
||||
}
|
||||
else
|
||||
{
|
||||
ImportResult.Add($"{w.Name} - ok");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return ImportResult;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user