39481-vm/api/audit-log.php
Flatlogic Bot 8be8405504 v1 unk
2026-04-05 09:55:47 +00:00

21 lines
555 B
PHP

<?php
declare(strict_types=1);
header('Content-Type: application/json; charset=utf-8');
require_once __DIR__ . '/../app/channel_data.php';
function audit_respond(int $status, array $payload): void
{
http_response_code($status);
echo json_encode($payload, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES);
exit;
}
try {
channel_app_bootstrap();
audit_respond(200, ['success' => true, 'data' => audit_log_list($_GET)]);
} catch (Throwable $e) {
audit_respond(500, ['success' => false, 'error' => 'Unable to load audit log.']);
}