adding search
Deploy / deploy (push) Successful in 9s

This commit is contained in:
2026-05-06 12:30:13 +02:00
parent ddcd7b0a5e
commit 556ac06413
4 changed files with 106 additions and 6 deletions
+14
View File
@@ -145,6 +145,20 @@ class Repository
)->fetchAll();
}
public function searchAlerts(string $query, int $limit = 100): array
{
$stmt = $this->db->pdo()->prepare(
"SELECT a.* FROM alerts a
JOIN alerts_fts fts ON a.id = fts.rowid
WHERE alerts_fts MATCH ?
ORDER BY rank
LIMIT ?"
);
$stmt->execute([$query, $limit]);
$rows = $stmt->fetchAll();
return array_map(fn(array $r) => Alert::fromRow($r), $rows);
}
// --- Config ---
public function getAllowedUserTokens(): array