diff options
author | eug-vs <eug-vs@keemail.me> | 2020-06-28 16:18:20 +0300 |
---|---|---|
committer | eug-vs <eug-vs@keemail.me> | 2020-06-28 16:18:20 +0300 |
commit | 02b0da08155c6615a48b8d7f49648c19c1600020 (patch) | |
tree | 5916962aacc99214780cc9c9ede7a0b0df160d1b /services/feedback | |
parent | 302a76985cef867f509a4180387cc45e934452d5 (diff) | |
download | which-api-02b0da08155c6615a48b8d7f49648c19c1600020.tar.gz |
feat: create feedback service
Diffstat (limited to 'services/feedback')
-rw-r--r-- | services/feedback/feedback.hooks.ts | 10 | ||||
-rw-r--r-- | services/feedback/feedback.service.ts | 13 |
2 files changed, 23 insertions, 0 deletions
diff --git a/services/feedback/feedback.hooks.ts b/services/feedback/feedback.hooks.ts new file mode 100644 index 0000000..04f3af1 --- /dev/null +++ b/services/feedback/feedback.hooks.ts @@ -0,0 +1,10 @@ +import { HookContext } from '@feathersjs/feathers'; +import requireAuth from '../../hooks/requireAuth'; +import signAuthority from '../../hooks/signAuthority'; + +export default { + before: { + create: [requireAuth, signAuthority] + } +}; + diff --git a/services/feedback/feedback.service.ts b/services/feedback/feedback.service.ts new file mode 100644 index 0000000..a15ede9 --- /dev/null +++ b/services/feedback/feedback.service.ts @@ -0,0 +1,13 @@ +import { Application } from '@feathersjs/express'; +import service from 'feathers-mongoose'; +import Model from '../../models/feedback/feedback.model'; + +import hooks from './feedback.hooks'; + +const FeebackService = service({ Model }); + +export default (app: Application): void => { + app.use('/feedback', FeebackService); + app.service('feedback').hooks(hooks); +}; + |