feat: refactor code to use responseOK everywhere (#2111)

* refactor: use responseOK return frontend format json data

* revert handle error

* revert handle error
This commit is contained in:
Yaodong Yu
2023-07-23 09:49:16 +08:00
committed by GitHub
parent fc9528be43
commit a6f803aff1
53 changed files with 178 additions and 218 deletions

View File

@ -45,8 +45,7 @@ func (c *ApiController) GetModels() {
return
}
c.Data["json"] = models
c.ServeJSON()
c.ResponseOk(models)
} else {
limit := util.ParseInt(limit)
count, err := object.GetModelCount(owner, field, value)
@ -82,8 +81,7 @@ func (c *ApiController) GetModel() {
return
}
c.Data["json"] = model
c.ServeJSON()
c.ResponseOk(model)
}
// UpdateModel