From 302a76985cef867f509a4180387cc45e934452d5 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Sun, 28 Jun 2020 16:13:34 +0300 Subject: feat: improve votes --- services/votes/votes.hooks.ts | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'services') diff --git a/services/votes/votes.hooks.ts b/services/votes/votes.hooks.ts index 7d0b3ba..56e9000 100644 --- a/services/votes/votes.hooks.ts +++ b/services/votes/votes.hooks.ts @@ -1,15 +1,9 @@ -import { HookContext } from '@feathersjs/feathers'; import requireAuth from '../../hooks/requireAuth'; - -const addUserId = async (context: HookContext): Promise => { - const { params: { user } } = context; - context.data.userId = user._id; - return context; -}; +import signAuthority from '../../hooks/signAuthority'; export default { before: { - create: [requireAuth, addUserId] + create: [requireAuth, signAuthority] } }; -- cgit v1.2.3