Skip to content

Commit

Permalink
Fix: correct API response format
Browse files Browse the repository at this point in the history
Signed-off-by: Z Zhang <zuoning@AndrewZs-MacBook-Air.local>
  • Loading branch information
Z Zhang authored and Z Zhang committed Jul 27, 2023
1 parent ba22bc2 commit f0b15f0
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions pkg/server/interfaces/api/application.go
Original file line number Diff line number Diff line change
Expand Up @@ -1046,23 +1046,19 @@ func (c *application) updateApplication(req *restful.Request, res *restful.Respo
// Verify the validity of parameters
var updateReq apis.UpdateApplicationRequest
if err := req.ReadEntity(&updateReq); err != nil {
klog.Info("read entity err", err)
bcode.ReturnError(req, res, err)
return
}
if err := validate.Struct(&updateReq); err != nil {
klog.Info("Validate err", err)
bcode.ReturnError(req, res, err)
return
}
base, err := c.ApplicationService.UpdateApplication(req.Request.Context(), app, updateReq)
if err != nil {
klog.Info("update app err", err)
bcode.ReturnError(req, res, err)
return
}
if err := res.WriteEntity(base); err != nil {
klog.Info("write entity err", err)
bcode.ReturnError(req, res, err)
return
}
Expand Down

0 comments on commit f0b15f0

Please sign in to comment.