output users + roles

This commit is contained in:
2020-04-24 12:46:25 +02:00
parent a44cc4b04d
commit 76e95d34f3
18 changed files with 430 additions and 99 deletions
+4 -3
View File
@@ -28,7 +28,7 @@ namespace zero.Web.Controllers
[AddToken]
public async Task<IActionResult> GetById([FromQuery] string id)
{
return await As<Country, CountryEditModel>(await Api.GetById(id));
return As<Country, CountryEditModel>(await Api.GetById(id));
}
@@ -37,7 +37,7 @@ namespace zero.Web.Controllers
/// </summary>
public async Task<IActionResult> GetAll([FromQuery] ListQuery<Country> query)
{
return Json(await Api.GetByQuery("en-US", query));
return As<Country, CountryListModel>(await Api.GetByQuery("en-US", query));
}
@@ -48,7 +48,8 @@ namespace zero.Web.Controllers
[ZeroAuthorize(Permissions.Settings.Countries, PermissionsValue.Write)]
public async Task<IActionResult> Save([FromBody] CountryEditModel model)
{
return Json(await Api.Save(Mapper.Map<CountryEditModel, Country>(model)));
Country country = Mapper.Map(model, await Api.GetById(model.Id));
return Json(await Api.Save(country));
}