Improve InvoicePayment() error handling.

This commit is contained in:
Gucheng Wang
2022-04-27 00:24:48 +08:00
parent e5c1f560c5
commit ea005aaf4d
11 changed files with 50 additions and 14 deletions

View File

@ -169,6 +169,9 @@ func (c *ApiController) InvoicePayment() {
id := c.Input().Get("id")
payment := object.GetPayment(id)
c.Data["json"] = wrapActionResponse(object.InvoicePayment(payment))
c.ServeJSON()
err := object.InvoicePayment(payment)
if err != nil {
c.ResponseError(err.Error())
}
c.ResponseOk()
}