fix: wrap model-groups API responses in SuccessResponse for api.js client
This commit is contained in:
@@ -17,7 +17,7 @@ func (s *Server) handleGetModelGroups(c *gin.Context) {
|
||||
if groups == nil {
|
||||
groups = []db.ModelGroup{}
|
||||
}
|
||||
c.JSON(http.StatusOK, groups)
|
||||
c.JSON(http.StatusOK, SuccessResponse(groups))
|
||||
}
|
||||
|
||||
func (s *Server) handleCreateModelGroup(c *gin.Context) {
|
||||
@@ -38,7 +38,7 @@ func (s *Server) handleCreateModelGroup(c *gin.Context) {
|
||||
}
|
||||
|
||||
s.refreshRouter()
|
||||
c.JSON(http.StatusCreated, group)
|
||||
c.JSON(http.StatusCreated, SuccessResponse(group))
|
||||
}
|
||||
|
||||
func (s *Server) handleUpdateModelGroup(c *gin.Context) {
|
||||
@@ -60,7 +60,7 @@ func (s *Server) handleUpdateModelGroup(c *gin.Context) {
|
||||
}
|
||||
|
||||
s.refreshRouter()
|
||||
c.JSON(http.StatusOK, group)
|
||||
c.JSON(http.StatusOK, SuccessResponse(group))
|
||||
}
|
||||
|
||||
func (s *Server) handleDeleteModelGroup(c *gin.Context) {
|
||||
|
||||
Reference in New Issue
Block a user