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