File tree Expand file tree Collapse file tree 2 files changed +11
-9
lines changed Expand file tree Collapse file tree 2 files changed +11
-9
lines changed Original file line number Diff line number Diff line change
1
+ import _ from 'lodash' ;
2
+ import { HookContext } from '@feathersjs/feathers' ;
3
+
4
+ export default async ( context : HookContext ) : Promise < HookContext > => {
5
+ _ . set ( context , 'params.query.$sort' , { createdAt : - 1 } ) ;
6
+ return context ;
7
+ }
8
+
Original file line number Diff line number Diff line change 1
- import _ from 'lodash' ;
2
- import { HookContext } from '@feathersjs/feathers' ;
3
1
import convertPoll from '../../hooks/convertPoll' ;
4
-
5
- const sort = async ( context : HookContext ) : Promise < HookContext > => {
6
- _ . set ( context , 'params.query.$sort' , { createdAt : - 1 } ) ;
7
- return context ;
8
- }
2
+ import sortByDate from '../../hooks/sortByDate' ;
9
3
10
4
export default {
11
5
before : {
12
- find : sort
6
+ find : sortByDate
13
7
} ,
14
8
after : {
15
- all : [ convertPoll ]
9
+ all : convertPoll
16
10
}
17
11
} ;
18
12
You can’t perform that action at this time.
0 commit comments