GreenField: Handle status codes, error models consistently

This commit is contained in:
Kukks
2020-06-03 11:58:49 +02:00
parent b9ef5af5d7
commit f313a5f221
7 changed files with 316 additions and 194 deletions

View File

@@ -137,7 +137,7 @@ namespace BTCPayServer.Controllers.GreenField
if (!string.IsNullOrEmpty(data.CustomCSSLink) && data.CustomCSSLink.Length > 500)
ModelState.AddModelError(nameof(data.CustomCSSLink), "CustomCSSLink is 500 chars max");
return !ModelState.IsValid ? BadRequest(new ValidationProblemDetails(ModelState)) : null;
return !ModelState.IsValid ? this.GetValidationResponse() :null;
}
private static Client.Models.PaymentRequestData FromModel(PaymentRequestData data)