fixing false positives ui
Deploy / deploy (push) Successful in 11s

This commit is contained in:
2026-05-16 11:30:56 +02:00
parent 9273b30e47
commit 201c786ae8
2 changed files with 8 additions and 2 deletions
+2 -1
View File
@@ -1036,7 +1036,8 @@ let fpItems = [];
async function loadFalsePositives() {
try {
fpItems = (await api('/false-positives')) || [];
const res = await api('/false-positives');
fpItems = res.data || res || [];
renderFalsePositives();
} catch (e) { console.error('fp load error', e); }
}
+6 -1
View File
@@ -95,7 +95,7 @@ class Router
=> $this->updateTelegramConfig(),
$path === '/false-positives' && $method === 'GET'
=> $this->repo->getFalsePositives(),
=> $this->getFalsePositives(),
$path === '/false-positives' && $method === 'POST'
=> $this->createFalsePositive(),
preg_match('#^/false-positives/(\d+)$#', $path, $m) && $method === 'DELETE'
@@ -337,6 +337,11 @@ class Router
return $this->repo->createFalsePositive($pattern, $description);
}
private function getFalsePositives(): array
{
return ['data' => $this->repo->getFalsePositives()];
}
private function deleteFalsePositive(int $id): array
{
$this->repo->deleteFalsePositive($id);