+2
-1
@@ -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
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user