diff options
Diffstat (limited to 'services')
-rw-r--r-- | services/feed/feed.hooks.ts | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/services/feed/feed.hooks.ts b/services/feed/feed.hooks.ts index 0e201db..33c6e71 100644 --- a/services/feed/feed.hooks.ts +++ b/services/feed/feed.hooks.ts @@ -1,6 +1,7 @@ import _ from 'lodash'; import { HookContext } from '@feathersjs/feathers'; - +import { iff, combine } from 'feathers-hooks-common'; +import isAuthenticated from '../../hooks/isAuthenticated'; const raiseNewVerifedPolls = async (context: HookContext): Promise<HookContext> => { // Raise unseen verified polls to the very top @@ -22,7 +23,10 @@ const lowerOldPolls = async (context: HookContext): Promise<HookContext> => { export default { after: { - find: [raiseNewVerifedPolls, lowerOldPolls] + find: [ + iff(isAuthenticated, raiseNewVerifedPolls), + iff(isAuthenticated, lowerOldPolls), + ] } }; |