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