aboutsummaryrefslogtreecommitdiff
path: root/services/polls/polls.hooks.ts
diff options
context:
space:
mode:
authorEugene Sokolov <eug-vs@keemail.me>2020-08-12 19:09:54 +0300
committerGitHub <noreply@github.com>2020-08-12 19:09:54 +0300
commit5462174ca076aef53d06b92372141c665c923ea3 (patch)
tree1bbe4629b0a0ee537a21be15c91fd31b243df97d /services/polls/polls.hooks.ts
parentc2e16321e679d52ad9d6e08b5cdb785b172ad830 (diff)
parent8f4ae4fd89cab5ba4f9e8d2750bc8589ce997ff1 (diff)
downloadwhich-api-5462174ca076aef53d06b92372141c665c923ea3.tar.gz
Merge pull request #19 from which-ecosystem/s3-reuploads
S3 reuploads
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'])
}
};