aboutsummaryrefslogtreecommitdiff
path: root/services/polls/polls.hooks.ts
diff options
context:
space:
mode:
Diffstat (limited to 'services/polls/polls.hooks.ts')
-rw-r--r--services/polls/polls.hooks.ts12
1 files changed, 3 insertions, 9 deletions
diff --git a/services/polls/polls.hooks.ts b/services/polls/polls.hooks.ts
index 524eaee..77fcc7a 100644
--- a/services/polls/polls.hooks.ts
+++ b/services/polls/polls.hooks.ts
@@ -1,18 +1,12 @@
-import _ from 'lodash';
-import { HookContext } from '@feathersjs/feathers';
import convertPoll from '../../hooks/convertPoll';
-
-const sort = async (context: HookContext): Promise<HookContext> => {
- _.set(context, 'params.query.$sort', { createdAt: - 1});
- return context;
-}
+import sortByDate from '../../hooks/sortByDate';
export default {
before: {
- find: sort
+ find: sortByDate
},
after: {
- all: [convertPoll]
+ all: convertPoll
}
};