aboutsummaryrefslogtreecommitdiff
path: root/hooks
diff options
context:
space:
mode:
authoreug-vs <eug-vs@keemail.me>2020-06-28 16:13:34 +0300
committereug-vs <eug-vs@keemail.me>2020-06-28 16:13:34 +0300
commit302a76985cef867f509a4180387cc45e934452d5 (patch)
treec79d2d95a79a9b452c7161ef0303e873fe7be0c1 /hooks
parente63122d84c65f30eb1e063504e7f16a05eb769f1 (diff)
downloadwhich-api-302a76985cef867f509a4180387cc45e934452d5.tar.gz
feat: improve votes
Diffstat (limited to 'hooks')
-rw-r--r--hooks/signAuthority.ts8
1 files changed, 8 insertions, 0 deletions
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<HookContext> => {
+ const { params: { user } } = context;
+ context.data.authorId = user._id;
+ return context;
+};
+