(ctx context.Context, namespace, name, currentUser string)
| 232 | } |
| 233 | |
| 234 | func (c *CodeComponent) Delete(ctx context.Context, namespace, name, currentUser string) error { |
| 235 | code, err := c.cs.FindByPath(ctx, namespace, name) |
| 236 | if err != nil { |
| 237 | return fmt.Errorf("failed to find code, error: %w", err) |
| 238 | } |
| 239 | |
| 240 | deleteDatabaseRepoReq := types.DeleteRepoReq{ |
| 241 | Username: currentUser, |
| 242 | Namespace: namespace, |
| 243 | Name: name, |
| 244 | RepoType: types.CodeRepo, |
| 245 | } |
| 246 | _, err = c.DeleteRepo(ctx, deleteDatabaseRepoReq) |
| 247 | if err != nil { |
| 248 | return fmt.Errorf("failed to delete repo of code, error: %w", err) |
| 249 | } |
| 250 | |
| 251 | err = c.cs.Delete(ctx, *code) |
| 252 | if err != nil { |
| 253 | return fmt.Errorf("failed to delete database code, error: %w", err) |
| 254 | } |
| 255 | return nil |
| 256 | } |
| 257 | |
| 258 | func (c *CodeComponent) Show(ctx context.Context, namespace, name, currentUser string) (*types.Code, error) { |
| 259 | var tags []types.RepoTag |
no test coverage detected