Update function 'local_webhooks_change_status'
Signed-off-by: Valentin Popov <info@valentineus.link>
This commit is contained in:
parent
98c33a639a
commit
82842e5ed8
7
lib.php
7
lib.php
@ -38,11 +38,8 @@ require_once(__DIR__ . "/locallib.php");
|
|||||||
function local_webhooks_change_status($serviceid) {
|
function local_webhooks_change_status($serviceid) {
|
||||||
global $DB;
|
global $DB;
|
||||||
|
|
||||||
$result = false;
|
$status = $DB->get_field(LOCAL_WEBHOOKS_TABLE_SERVICES, "status", array("id" => $serviceid), IGNORE_MISSING);
|
||||||
if ($record = local_webhooks_get_record($serviceid)) {
|
$result = $DB->set_field(LOCAL_WEBHOOKS_TABLE_SERVICES, "status", !boolval($status), array("id" => $serviceid));
|
||||||
$record->enable = !boolval($record->enable);
|
|
||||||
$result = local_webhooks_update_record($record);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user