MCPcopy Index your code
hub / github.com/bytebase/bytebase / DeleteProjectWebhook

Method DeleteProjectWebhook

backend/store/project_webhook.go:221–235  ·  view source on GitHub ↗

DeleteProjectWebhook deletes an existing projectWebhook by resource ID.

(ctx context.Context, projectResourceID string, webhookResourceID string)

Source from the content-addressed store, hash-verified

219
220// DeleteProjectWebhook deletes an existing projectWebhook by resource ID.
221func (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}

Callers 1

RemoveWebhookMethod · 0.80

Calls 5

GetDBMethod · 0.95
removeProjectCacheMethod · 0.95
QFunction · 0.92
SpaceMethod · 0.80
ToSQLMethod · 0.80

Tested by

no test coverage detected