Skip to content
This repository has been archived by the owner on Nov 16, 2023. It is now read-only.

Commit

Permalink
Fixes deprecated pine orderby query (#9)
Browse files Browse the repository at this point in the history
Change-type: patch
  • Loading branch information
otaviojacobi authored Feb 14, 2023
1 parent 79bba6b commit dfc82ba
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
11 changes: 10 additions & 1 deletion src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,16 @@ import { featuredPage } from './featuredPage';

export const app = express();

app.use(morgan('combined'));
app.use(
morgan('short', {
skip: (_req: express.Request, res: express.Response) => {
return (
!(process.env.LOG_SUCCESS_RESPONSE === 'true') && res.statusCode < 400
);
},
}),
);

app.use(healthRouter);
app.use('/popularity', popularity);
app.use('/featured-page', featuredPage);
12 changes: 10 additions & 2 deletions src/popularity/fleet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,16 @@ export const getActiveFleets = async () => {
},
},
},
$orderby:
'owns__public_device/$count($filter=was_recently_online eq 1) desc',
$orderby: {
owns__public_device: {
$count: {
$filter: {
was_recently_online: true,
},
},
},
$dir: 'desc',
},
},
})) as unknown as Fleet[];

Expand Down

0 comments on commit dfc82ba

Please sign in to comment.