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 --- hooks/signAuthority.ts | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 hooks/signAuthority.ts (limited to 'hooks') diff --git a/hooks/signAuthority.ts b/hooks/signAuthority.ts new file mode 100644 index 0000000..b4d74b8 --- /dev/null +++ b/hooks/signAuthority.ts @@ -0,0 +1,8 @@ +import { HookContext } from '@feathersjs/feathers'; + +export default async (context: HookContext): Promise => { + const { params: { user } } = context; + context.data.authorId = user._id; + return context; +}; + -- cgit v1.2.3