DeleteProjectWebhook deletes an existing projectWebhook by resource ID.
(ctx context.Context, projectResourceID string, webhookResourceID string)
| 219 | |
| 220 | // DeleteProjectWebhook deletes an existing projectWebhook by resource ID. |
| 221 | func (s *Store) DeleteProjectWebhook(ctx context.Context, projectResourceID string, webhookResourceID string) error { |
| 222 | q := qb.Q().Space("DELETE FROM project_webhook WHERE resource_id = ?", webhookResourceID) |
| 223 | |
| 224 | query, args, err := q.ToSQL() |
| 225 | if err != nil { |
| 226 | return errors.Wrapf(err, "failed to build sql") |
| 227 | } |
| 228 | |
| 229 | if _, err := s.GetDB().ExecContext(ctx, query, args...); err != nil { |
| 230 | return err |
| 231 | } |
| 232 | |
| 233 | s.removeProjectCache(projectResourceID) |
| 234 | return nil |
| 235 | } |
no test coverage detected