diff --git a/lib.php b/lib.php index 6227e25..b3b2659 100644 --- a/lib.php +++ b/lib.php @@ -199,6 +199,7 @@ function local_webhooks_delete_record($serviceid) { global $DB; $result = $DB->delete_records(LOCAL_WEBHOOKS_TABLE_SERVICES, array("id" => $serviceid)); + local_webhooks_delete_events_for_service($serviceid); /* Clear the plugin cache */ local_webhooks_cache_reset();