feat(search): search public news events users and open rooms
This commit is contained in:
1 parent
506e14783c
commit
ba9c61d808
5 files changed
+424
-184
No files matched your search
@@ -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(
|
||||
|
||||
Reference in new issue
Block a user