From 676c722a994a214c182bcf26b80eab09ebf9f61e Mon Sep 17 00:00:00 2001 From: eug-vs Date: Mon, 22 Jun 2020 21:29:17 +0300 Subject: refactor: unite convertPoll hooks --- services/polls/polls.hooks.ts | 8 ++------ services/profiles/profiles.hooks.ts | 6 ++---- services/votes/votes.hooks.ts | 7 ++----- 3 files changed, 6 insertions(+), 15 deletions(-) (limited to 'services') diff --git a/services/polls/polls.hooks.ts b/services/polls/polls.hooks.ts index a914cd0..eba3e63 100644 --- a/services/polls/polls.hooks.ts +++ b/services/polls/polls.hooks.ts @@ -1,12 +1,8 @@ -import { - convertPollHook, - convertPollManyHook -} from '../../hooks/convertPoll'; +import convertPoll from '../../hooks/convertPoll'; export default { after: { - get: [convertPollHook], - find: [convertPollManyHook] + all: [convertPoll], } }; diff --git a/services/profiles/profiles.hooks.ts b/services/profiles/profiles.hooks.ts index 4447bee..13d6f63 100644 --- a/services/profiles/profiles.hooks.ts +++ b/services/profiles/profiles.hooks.ts @@ -1,10 +1,8 @@ -import { - convertPollManyHook -} from '../../hooks/convertPoll'; +import convertPoll from '../../hooks/convertPoll'; export default { after: { - get: [convertPollManyHook] + all: [convertPoll] } }; diff --git a/services/votes/votes.hooks.ts b/services/votes/votes.hooks.ts index 2e29008..a41b8a9 100644 --- a/services/votes/votes.hooks.ts +++ b/services/votes/votes.hooks.ts @@ -1,15 +1,12 @@ -import { - convertPollHook -} from '../../hooks/convertPoll'; - import { authenticate } from '@feathersjs/authentication'; +import convertPoll from '../../hooks/convertPoll'; export default { before: { create: [authenticate('jwt')] }, after: { - all: [convertPollHook] + all: [convertPoll] } }; -- cgit v1.2.3