Updated the function to update the record
This commit is contained in:
parent
51007a0fb5
commit
7d1a0b9fec
5
lib.php
5
lib.php
@ -120,10 +120,11 @@ function local_webhooks_create_record($record) {
|
|||||||
function local_webhooks_update_record($record) {
|
function local_webhooks_update_record($record) {
|
||||||
global $DB;
|
global $DB;
|
||||||
|
|
||||||
if (!empty($record->events)) {
|
if (empty($record->id)) {
|
||||||
$record->events = local_webhooks_serialization_data($record->events);
|
print_error("missingparam", "error", null, "id");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$record->events = !empty($record->events) ? local_webhooks_serialization_data($record->events) : null;
|
||||||
$result = $DB->update_record("local_webhooks_service", $record, false);
|
$result = $DB->update_record("local_webhooks_service", $record, false);
|
||||||
local_webhooks_events::service_updated($record->id);
|
local_webhooks_events::service_updated($record->id);
|
||||||
return boolval($result);
|
return boolval($result);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user