aboutsummaryrefslogtreecommitdiff
path: root/hooks/sortByDate.ts
blob: 4a20920a71587b67db9175e87e598c885555175f (plain)
1
2
3
4
5
6
7
8
import _ from 'lodash';
import { HookContext } from '@feathersjs/feathers';

export default async (context: HookContext): Promise<HookContext> => {
  _.set(context, 'params.query.$sort', { createdAt: - 1});
  return context;
}