(_ context.Context, poolID string)
| 82 | } |
| 83 | |
| 84 | func (s *sqlDatabase) DeletePoolByID(_ context.Context, poolID string) (err error) { |
| 85 | pool, err := s.getPoolByID(s.conn, poolID) |
| 86 | if err != nil { |
| 87 | return fmt.Errorf("error fetching pool by ID: %w", err) |
| 88 | } |
| 89 | |
| 90 | defer func() { |
| 91 | if err == nil { |
| 92 | s.sendNotify(common.PoolEntityType, common.DeleteOperation, params.Pool{ID: poolID}) |
| 93 | } |
| 94 | }() |
| 95 | |
| 96 | if q := s.conn.Unscoped().Delete(&pool); q.Error != nil { |
| 97 | return fmt.Errorf("error removing pool: %w", q.Error) |
| 98 | } |
| 99 | |
| 100 | return nil |
| 101 | } |
| 102 | |
| 103 | func (s *sqlDatabase) getEntityPool(tx *gorm.DB, entityType params.ForgeEntityType, entityID, poolID string, preload ...string) (Pool, error) { |
| 104 | if entityID == "" { |
nothing calls this directly
no test coverage detected