diff options
author | Eugene Sokolov <eug-vs@keemail.me> | 2020-06-27 18:33:02 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-27 18:33:02 +0300 |
commit | 990edc953d734b1f1621fc0f5161c1eb978a3ea0 (patch) | |
tree | a8759f1d34e55d809a5b702fdca60a82117e1a2e /hooks/sortByDate.ts | |
parent | 08994137ddbeee5c3d407c215575e9681fd3962b (diff) | |
parent | 0a6a6be1b43635c60e76669ac2a7ee8581d9b183 (diff) | |
download | which-api-990edc953d734b1f1621fc0f5161c1eb978a3ea0.tar.gz |
Merge pull request #14 from which-ecosystem/feed
Feed endpoint
Diffstat (limited to 'hooks/sortByDate.ts')
-rw-r--r-- | hooks/sortByDate.ts | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/hooks/sortByDate.ts b/hooks/sortByDate.ts new file mode 100644 index 0000000..9dd1222 --- /dev/null +++ b/hooks/sortByDate.ts @@ -0,0 +1,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; +}; + |