MCPcopy Create free account
hub / github.com/tbphp/gpt-load / AddSubGroups

Method AddSubGroups

internal/handler/group_handler.go:458–476  ·  view source on GitHub ↗

AddSubGroups handles adding sub groups to an aggregate group

(c *gin.Context)

Source from the content-addressed store, hash-verified

456
457// AddSubGroups handles adding sub groups to an aggregate group
458func (s *Server) AddSubGroups(c *gin.Context) {
459 id, err := strconv.Atoi(c.Param("id"))
460 if err != nil {
461 response.ErrorI18nFromAPIError(c, app_errors.ErrBadRequest, "validation.invalid_group_id")
462 return
463 }
464
465 var req AddSubGroupsRequest
466 if err := c.ShouldBindJSON(&req); err != nil {
467 response.Error(c, app_errors.NewAPIError(app_errors.ErrInvalidJSON, err.Error()))
468 return
469 }
470
471 if err := s.AggregateGroupService.AddSubGroups(c.Request.Context(), uint(id), req.SubGroups); s.handleGroupError(c, err) {
472 return
473 }
474
475 response.SuccessI18n(c, "success.sub_groups_added", nil)
476}
477
478// UpdateSubGroupWeight handles updating the weight of a sub group
479func (s *Server) UpdateSubGroupWeight(c *gin.Context) {

Callers

nothing calls this directly

Calls 5

handleGroupErrorMethod · 0.95
ErrorI18nFromAPIErrorFunction · 0.92
ErrorFunction · 0.92
SuccessI18nFunction · 0.92
ErrorMethod · 0.45

Tested by

no test coverage detected