check ps.trending before hiding non-explorable users from /users endpoint

This commit is contained in:
Hazelnoot 2025-05-11 05:25:59 -04:00
parent b4bce57fcb
commit 0b8c101d71

View file

@ -67,9 +67,12 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
) {
super(meta, paramDef, async (ps, me) => {
const query = this.usersRepository.createQueryBuilder('user')
.where('user.isExplorable = TRUE')
.andWhere('user.isSuspended = FALSE');
if (ps.trending) {
query.andWhere('user.isExplorable = TRUE');
}
switch (ps.state) {
case 'alive': query.andWhere('user.updatedAt > :date', { date: new Date(Date.now() - 1000 * 60 * 60 * 24 * 5) }); break;
}