MCPcopy Create free account
hub / github.com/APIParkLab/APIPark / Delete

Method Delete

module/ai-api/iml.go:213–232  ·  view source on GitHub ↗
(ctx context.Context, serviceId string, apiId string)

Source from the content-addressed store, hash-verified

211}
212
213func (i *imlAPIModule) Delete(ctx context.Context, serviceId string, apiId string) error {
214 info, err := i.serviceService.Get(ctx, serviceId)
215 if err != nil {
216 return err
217 }
218 if info.Kind != service.AIService {
219 return fmt.Errorf("service kind is not ai service")
220 }
221 return i.transaction.Transaction(ctx, func(txCtx context.Context) error {
222 apiInfo, err := i.aiAPIService.Get(ctx, apiId)
223 if err != nil {
224 return err
225 }
226 err = i.deleteAPIDoc(ctx, serviceId, apiInfo.Path)
227 if err != nil {
228 return err
229 }
230 return i.aiAPIService.Delete(ctx, apiId)
231 })
232}
233
234func (i *imlAPIModule) List(ctx context.Context, keyword string, serviceId string) ([]*ai_api_dto.APIItem, error) {
235 info, err := i.serviceService.Get(ctx, serviceId)

Callers

nothing calls this directly

Calls 3

deleteAPIDocMethod · 0.95
GetMethod · 0.65
DeleteMethod · 0.65

Tested by

no test coverage detected