v3: search engine, responsive header with compact user menu
This commit is contained in:
@@ -102,6 +102,15 @@ export function searchUsers(
|
||||
}));
|
||||
}
|
||||
|
||||
export function searchUsersGlobal(query: string, limit: number): User[] {
|
||||
if (!query.trim()) return [];
|
||||
const pattern = `%${query}%`;
|
||||
const rows = db.prepare(
|
||||
`${USER_SELECT} WHERE (u.username LIKE ? OR u.description LIKE ?) ORDER BY u.username LIMIT ?;`,
|
||||
).all(pattern, pattern, limit);
|
||||
return rows.filter(isUserRow).map(userRowToApi);
|
||||
}
|
||||
|
||||
export function listUsers(): User[] {
|
||||
const userRows = db.prepare(
|
||||
`${USER_SELECT}`,
|
||||
|
||||
Reference in New Issue
Block a user