Searchlog: Allow searching only a username
Some checks are pending
Node.js CI / build (18.x) (push) Waiting to run

This commit is contained in:
Mia 2025-07-17 23:26:21 -05:00
parent 4d4c541a57
commit 2b7e1d48b5

View File

@ -871,7 +871,8 @@ export class DatabaseLogSearcher extends Searcher {
const results = await Rooms.Roomlogs.table.selectAll()`
WHERE ${user ? SQL`userid = ${user} AND ` : SQL``}
time BETWEEN ${monthStart}::int::timestamp AND ${monthEnd}::int::timestamp AND
type = ${'c'} AND roomid = ${roomid} AND content @@ plainto_tsquery(${search}) LIMIT ${limit}
type = ${'c'} AND roomid = ${roomid}
${toID(search).length ? SQL` AND content @@ plainto_tsquery(${search})` : SQL``} LIMIT ${limit}
`;
let curDate = '';