(ctx context.Context, serviceId string, apiId string)
| 211 | } |
| 212 | |
| 213 | func (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 | |
| 234 | func (i *imlAPIModule) List(ctx context.Context, keyword string, serviceId string) ([]*ai_api_dto.APIItem, error) { |
| 235 | info, err := i.serviceService.Get(ctx, serviceId) |
nothing calls this directly
no test coverage detected