aboutsummaryrefslogtreecommitdiff
path: root/services/polls/polls.hooks.ts
diff options
context:
space:
mode:
authoreug-vs <eug-vs@keemail.me>2020-08-12 18:42:29 +0300
committereug-vs <eug-vs@keemail.me>2020-08-12 18:42:29 +0300
commit4b2397d68b62d9f5682d1fd9f4fb2082ac4aa260 (patch)
tree98ee0ebb37ba576ba1c0faad75fed76ae4c3a022 /services/polls/polls.hooks.ts
parentf08e2a37677e711cad7397c532670913645f010a (diff)
downloadwhich-api-4b2397d68b62d9f5682d1fd9f4fb2082ac4aa260.tar.gz
feat: impelemnt fetchImages hook
Diffstat (limited to 'services/polls/polls.hooks.ts')
-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 35eae29..7a5b1da 100644
--- a/services/polls/polls.hooks.ts
+++ b/services/polls/polls.hooks.ts
@@ -8,6 +8,7 @@ import { PollSchema } from '../../models/polls/poll.schema';
import VoteModel from '../../models/votes/vote.model';
import sortByDate from '../../hooks/sortByDate';
import signAuthority from '../../hooks/signAuthority';
+import fetchImages from '../../hooks/fetchImages';
const convertPoll = async (context: HookContext): Promise<HookContext> => {
@@ -53,7 +54,8 @@ export default {
patch: disallow('external')
},
after: {
- all: convertPoll
+ all: convertPoll,
+ create: fetchImages(['contents.left.url', 'contents.right.url'])
}
};