This commit is contained in:
@@ -14,6 +14,7 @@ using AyaNova.Biz;
|
||||
using System;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Serialization;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System.Linq;
|
||||
using AyaNova.Util;
|
||||
|
||||
@@ -402,10 +403,10 @@ namespace AyaNova.Api.Controllers
|
||||
//deserialize each file and import
|
||||
foreach (UploadedFileInfo a in uploadFormData.UploadedFiles)
|
||||
{
|
||||
if (!await biz.ImportAsync(ImportJson))
|
||||
JObject o = JObject.Parse(System.IO.File.ReadAllText(a.InitialUploadedPathName));
|
||||
if (!await biz.ImportAsync(o))
|
||||
{
|
||||
//delete all the files temporarily uploaded and return bad request
|
||||
|
||||
DeleteTempUploadFile(uploadFormData);
|
||||
return BadRequest(new ApiErrorResponse(biz.Errors));
|
||||
}
|
||||
|
||||
@@ -129,6 +129,8 @@ namespace AyaNova.Biz
|
||||
//
|
||||
internal async Task<bool> ImportAsync(JObject o)
|
||||
{
|
||||
|
||||
var v = o.Count;
|
||||
// Translation dbObject = await ct.Translation.Include(z => z.TranslationItems).SingleOrDefaultAsync(z => z.Id == id);
|
||||
|
||||
// if (dbObject == null)
|
||||
|
||||
Reference in New Issue
Block a user