start backoffice users

This commit is contained in:
2020-04-03 18:03:36 +02:00
parent 92894f982b
commit 0ed7090669
18 changed files with 139 additions and 93 deletions
+10 -1
View File
@@ -1,5 +1,7 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Linq;
using System.Threading.Tasks;
using zero.Core;
using zero.Core.Api;
@@ -29,7 +31,14 @@ namespace zero.Web.Setup
public async Task<IActionResult> Install([FromBody] SetupModel model)
{
EntityChangeResult<SetupModel> result = await Api.Install(model);
return Json(result);
if (result.IsSuccess)
{
return Json(result);
}
object value = String.Join("\n\n", result.Errors.Select(error => error.Message + "\n(property: " + error.Property + ")"));
return StatusCode(500, value);
}
}
}