MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / Delete

Method Delete

agent/app/service/group.go:66–81  ·  view source on GitHub ↗
(id uint)

Source from the content-addressed store, hash-verified

64}
65
66func (u *GroupService) Delete(id uint) error {
67 group, _ := groupRepo.Get(repo.WithByID(id))
68 if group.ID == 0 {
69 return buserr.New("ErrRecordNotFound")
70 }
71 if group.IsDefault {
72 return buserr.New("ErrGroupIsDefault")
73 }
74 if group.Type == "website" {
75 websites, _ := websiteRepo.List(websiteRepo.WithGroupID(group.ID))
76 if len(websites) > 0 {
77 return buserr.New("ErrGroupIsInWebsiteUse")
78 }
79 }
80 return groupRepo.Delete(repo.WithByID(id))
81}
82
83func (u *GroupService) Update(req dto.GroupUpdate) error {
84 if req.IsDefault {

Callers

nothing calls this directly

Calls 5

GetMethod · 0.65
WithByIDMethod · 0.65
ListMethod · 0.65
WithGroupIDMethod · 0.65
DeleteMethod · 0.65

Tested by

no test coverage detected