fix: Server error when invalid 'sort' field is passed from an API client (#2000)

This commit is contained in:
Tom Moor
2021-03-31 18:54:02 -07:00
committed by GitHub
parent 2e64972574
commit 2ef0caba88
8 changed files with 34 additions and 4 deletions

View File

@ -22,6 +22,7 @@ router.post("events.list", auth(), pagination(), async (ctx) => {
auditLog = false,
} = ctx.body;
if (direction !== "ASC") direction = "DESC";
ctx.assertSort(sort, Event);
let where = {
name: Event.ACTIVITY_EVENTS,