Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
nenohi committed Aug 22, 2024
1 parent d1b479f commit 336491c
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions packages/backend/src/server/api/endpoints/users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,9 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
}
const chartUsers: { userId: string; count: number; }[] = [];
if (ps.sort?.endsWith('pv')) {
if (ps.sort === '+pv') {
await this.perUserPvChart.getChartUsers('day', 0, null, ps.limit, ps.offset, 'DESC').then(users => {
await this.perUserPvChart.getChartUsers('day', 0, null, ps.limit, ps.offset, ps.sort === '+pv' ? 'DESC' : 'ASC').then(users => {
chartUsers.push(...users);
});
} else if (ps.sort === '-pv') {
await this.perUserPvChart.getChartUsers('day', 0, null, ps.limit, ps.offset, 'ASC').then(users => {
chartUsers.push(...users);
});
}
}
switch (ps.sort) {
case '+follower': query.orderBy('user.followersCount', 'DESC'); break;
Expand Down

0 comments on commit 336491c

Please sign in to comment.