nesting in error response

This commit is contained in:
Chika 2021-02-26 16:00:49 +03:00
parent f60b9ecd55
commit 5972453386

View File

@ -45,11 +45,19 @@ namespace EvoCalculator.Core.Controllers.V1
if (errors != null && errors.Count > 0)
{
return StatusCode(500, JsonConvert.SerializeObject(errors,
new JsonSerializerSettings {Formatting = Formatting.Indented}));
return StatusCode(500, JsonConvert.SerializeObject(
new
{
errors
},
new JsonSerializerSettings
{
Formatting = Formatting.Indented
}));
}
return Ok(JsonConvert.SerializeObject(res,
return Ok(JsonConvert.SerializeObject(
res,
new JsonSerializerSettings
{
Formatting = Formatting.Indented,