diff options
author | eug-vs <eug-vs@keemail.me> | 2021-03-20 19:56:54 +0300 |
---|---|---|
committer | eug-vs <eug-vs@keemail.me> | 2021-03-20 19:56:54 +0300 |
commit | afa1d1371c10878f395f95279beac5bb0aec6963 (patch) | |
tree | 723537bbdf05c6bdc293f3de659392f36bc67992 /src/services/index.ts | |
parent | 3188db84ca5a0ba6eebbc8ea4cd87d4aa3cebb89 (diff) | |
download | commercel-api-afa1d1371c10878f395f95279beac5bb0aec6963.tar.gz |
feat: add default sort by createdAt
Diffstat (limited to 'src/services/index.ts')
-rw-r--r-- | src/services/index.ts | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/services/index.ts b/src/services/index.ts index 2c3430c..42b1fbd 100644 --- a/src/services/index.ts +++ b/src/services/index.ts @@ -5,6 +5,7 @@ import Waybills from './waybills.service'; import Tranfers from './transfers.service'; import Spreadsheets from './spreadsheets.service'; import Uploads from './uploads.service'; +import sortByDate from '../hooks/sortByDate'; export default (app: Application): void => { app.configure(Products); @@ -15,4 +16,10 @@ export default (app: Application): void => { app.configure(Uploads); app.get('/ping', (req, res) => res.send('pong')); + + app.hooks({ + before: { + find: sortByDate + }, + }) }; |