| Conditions | 3 |
| Total Lines | 14 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | package memory |
||
| 39 | func (b *BundleWriter) Delete(ctx context.Context, tenantID, name string) (err error) { |
||
| 40 | txn := b.database.DB.Txn(true) |
||
| 41 | raw, err := txn.First(constants.BundlesTable, "id", tenantID, name) |
||
| 42 | |||
| 43 | if raw == nil { |
||
| 44 | return errors.New(base.ErrorCode_ERROR_CODE_BUNDLE_NOT_FOUND.String()) |
||
| 45 | } |
||
| 46 | err = txn.Delete(constants.BundlesTable, raw) |
||
| 47 | if err != nil { |
||
| 48 | return err |
||
| 49 | } |
||
| 50 | txn.Commit() |
||
| 51 | |||
| 52 | return nil |
||
| 53 | } |
||
| 54 |