fix: Server error when invalid 'sort' field is passed from an API client (#2000)
This commit is contained in:
@ -34,6 +34,7 @@ router.post("revisions.info", auth(), async (ctx) => {
|
||||
router.post("revisions.list", auth(), pagination(), async (ctx) => {
|
||||
let { documentId, sort = "updatedAt", direction } = ctx.body;
|
||||
if (direction !== "ASC") direction = "DESC";
|
||||
ctx.assertSort(sort, Revision);
|
||||
ctx.assertPresent(documentId, "documentId is required");
|
||||
|
||||
const user = ctx.state.user;
|
||||
|
Reference in New Issue
Block a user