aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoreug-vs <eug-vs@keemail.me>2020-06-30 01:35:17 +0300
committereug-vs <eug-vs@keemail.me>2020-06-30 01:35:17 +0300
commitda76bb1bd8797c4e1dc657c489f597bf64918ceb (patch)
treea90020af7f0908e36908bb2ae434223f45ccdc6c
parent88e97a42096c1e4de7b9f1d8fefa0829bbc0d321 (diff)
downloadwhich-api-da76bb1bd8797c4e1dc657c489f597bf64918ceb.tar.gz
fix: signAuthority on creating poll
-rw-r--r--services/polls/polls.hooks.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/services/polls/polls.hooks.ts b/services/polls/polls.hooks.ts
index 9f2183f..e3d04e7 100644
--- a/services/polls/polls.hooks.ts
+++ b/services/polls/polls.hooks.ts
@@ -6,6 +6,7 @@ import { Poll } from 'which-types';
import { PollSchema } from '../../models/polls/poll.schema';
import VoteModel from '../../models/votes/vote.model';
import sortByDate from '../../hooks/sortByDate';
+import signAuthority from '../../hooks/signAuthority';
const convertPoll = async (context: HookContext): Promise<HookContext> => {
@@ -44,7 +45,8 @@ const convertPoll = async (context: HookContext): Promise<HookContext> => {
export default {
before: {
- find: sortByDate
+ find: sortByDate,
+ create: signAuthority
},
after: {
all: convertPoll