feat(search): search public news events users and open rooms
CI / check (push) Failing after 54s
CI / deploy (push) Skipped
CI / publish-container (push) Skipped

This commit is contained in:
Simo committed 2026-09-11 00:29:54 +02:00
1 parent 506e14783c
commit ba9c61d808
5 files changed
+424 -184

No files matched your search

+3 -1
View File
@@ -5,7 +5,9 @@ import { db, WebsiteArticles } from "@/lib/db";
export async function loadNewsArchive(
options: { search?: string; page?: number; order?: string } = {},
) {
const search = (options.search ?? "").trim().slice(0, 191);
const search = (typeof options.search === "string" ? options.search : "")
.trim()
.slice(0, 191);
const order = options.order === "oldest" ? "oldest" : "newest";
const publishedAt =
sql<Date | null>`COALESCE(${WebsiteArticles.publishAt}, ${WebsiteArticles.createdAt})`.mapWith(