From 4b2397d68b62d9f5682d1fd9f4fb2082ac4aa260 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Wed, 12 Aug 2020 18:42:29 +0300 Subject: feat: impelemnt fetchImages hook --- services/users/users.hooks.ts | 3 +++ 1 file changed, 3 insertions(+) (limited to 'services/users') diff --git a/services/users/users.hooks.ts b/services/users/users.hooks.ts index 29f1074..ddfc47f 100644 --- a/services/users/users.hooks.ts +++ b/services/users/users.hooks.ts @@ -4,6 +4,7 @@ import { discard, disallow } from 'feathers-hooks-common'; import { HookContext } from '@feathersjs/feathers'; import { NotAuthenticated } from '@feathersjs/errors'; import requireAuth from '../../hooks/requireAuth'; +import fetchImages from '../../hooks/fetchImages'; const hashPassword = hooks.hashPassword('password'); @@ -24,6 +25,8 @@ const compareUser = async (context: HookContext): Promise => { export default { after: { all: hooks.protect('password'), + create: fetchImages(['avatarUrl']), + patch: fetchImages(['avatarUrl']), get: discard('password') // Protect password from local get's }, before: { -- cgit v1.2.3