aboutsummaryrefslogtreecommitdiff
path: root/editservice.php
diff options
context:
space:
mode:
Diffstat (limited to 'editservice.php')
-rw-r--r--editservice.php12
1 files changed, 11 insertions, 1 deletions
diff --git a/editservice.php b/editservice.php
index 8b065ff..4564909 100644
--- a/editservice.php
+++ b/editservice.php
@@ -71,9 +71,19 @@ if ($data = $mform->get_data()) {
if ($editing) {
$data->id = $serviceid;
$DB->update_record("local_webhooks_service", $data);
+
+ /* Run the event */
+ $event = \local_webhooks\event\service_updated::create(array("context" => $context, "objectid" => $data->id));
+ $event->trigger();
+
redirect($managerservice, new lang_string("eventwebserviceserviceupdated", "webservice"));
} else {
- $DB->insert_record("local_webhooks_service", $data);
+ $servicenewid = $DB->insert_record("local_webhooks_service", $data);
+
+ /* Run the event */
+ $event = \local_webhooks\event\service_added::create(array("context" => $context, "objectid" => $servicenewid));
+ $event->trigger();
+
redirect($managerservice, new lang_string("eventwebserviceservicecreated", "webservice"));
}
}