log
This commit is contained in:
@@ -1299,6 +1299,19 @@ class ApiKernel
|
||||
if (!$row) $this->fail('Not found', ['id' => $versionId], 404);
|
||||
|
||||
$ok = $this->activateContentVersion($customerId, (int)$row['content_id'], $versionId);
|
||||
debug_log_write('templates_toggle', [
|
||||
'time' => date(DATE_ATOM),
|
||||
'action' => 'content_versions.activate',
|
||||
'customer_id' => $customerId,
|
||||
'content_id' => (int)$row['content_id'],
|
||||
'version_id' => $versionId,
|
||||
'ok' => $ok,
|
||||
'input' => $this->in,
|
||||
], [
|
||||
'append' => true,
|
||||
'json' => true,
|
||||
'newline' => true,
|
||||
]);
|
||||
if (!$ok) $this->fail('Activation failed', ['id' => $versionId], 500);
|
||||
$this->respond(['ok' => true, 'activated' => true, 'id' => $versionId]);
|
||||
}
|
||||
@@ -1312,6 +1325,18 @@ class ApiKernel
|
||||
if ($contentId <= 0) $this->fail('content_id required', null, 422);
|
||||
|
||||
$ok = $this->deactivateContentVersion($customerId, $contentId);
|
||||
debug_log_write('templates_toggle', [
|
||||
'time' => date(DATE_ATOM),
|
||||
'action' => 'content_versions.deactivate',
|
||||
'customer_id' => $customerId,
|
||||
'content_id' => $contentId,
|
||||
'ok' => $ok,
|
||||
'input' => $this->in,
|
||||
], [
|
||||
'append' => true,
|
||||
'json' => true,
|
||||
'newline' => true,
|
||||
]);
|
||||
if (!$ok) $this->fail('Deactivation failed', ['content_id' => $contentId], 500);
|
||||
$this->respond(['ok' => true, 'deactivated' => true, 'content_id' => $contentId]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user