mirror of
https://codeberg.org/yeentown/barkey.git
synced 2025-07-07 20:44:34 +00:00
check ps.trending before hiding non-explorable users from /users endpoint
This commit is contained in:
parent
b4bce57fcb
commit
0b8c101d71
1 changed files with 4 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue