MCPcopy Index your code
hub / github.com/APIParkLab/APIPark / Delete

Method Delete

module/team/iml.go:145–164  ·  view source on GitHub ↗
(ctx context.Context, id string)

Source from the content-addressed store, hash-verified

143}
144
145func (m *imlTeamModule) Delete(ctx context.Context, id string) error {
146 err := m.transaction.Transaction(ctx, func(ctx context.Context) error {
147 count, err := m.serviceService.Count(ctx, "", map[string]interface{}{
148 "team": id,
149 "is_delete": false,
150 })
151 if err != nil {
152 return err
153 }
154 if count != 0 {
155 return fmt.Errorf("team has projects,cannot delete")
156 }
157 err = m.service.Delete(ctx, id)
158 if err != nil {
159 return err
160 }
161 return nil
162 })
163 return err
164}

Callers

nothing calls this directly

Calls 2

CountMethod · 0.65
DeleteMethod · 0.65

Tested by

no test coverage detected