diff --git a/packages/schema/src/hooks/resolve.ts b/packages/schema/src/hooks/resolve.ts index 8c36b5778a..c891ec1b65 100644 --- a/packages/schema/src/hooks/resolve.ts +++ b/packages/schema/src/hooks/resolve.ts @@ -143,10 +143,10 @@ export const resolveDispatch = const status = context.params.resolve const { isPaginated, data } = getData(context) const resolveAndGetDispatch = async (current: any) => { - const resolved = await runResolvers(resolvers, current, ctx, status) + const resolved: any = await runResolvers(resolvers, current, ctx, status) return Object.keys(resolved).reduce((res, key) => { - res[key] = getDispatch(current[key]) + res[key] = getDispatch(resolved[key]) return res }, {} as any) diff --git a/packages/schema/test/fixture.ts b/packages/schema/test/fixture.ts index 05f83d199d..d32932fc8c 100644 --- a/packages/schema/test/fixture.ts +++ b/packages/schema/test/fixture.ts @@ -63,7 +63,8 @@ export const userResultResolver = resolve>( export const userDispatchResolver = resolve>({ schema: userResultSchema, properties: { - password: () => undefined + password: async () => undefined, + email: async () => '[redacted]' } }) diff --git a/packages/schema/test/hooks.test.ts b/packages/schema/test/hooks.test.ts index 84e10c0d1f..de1a2b22da 100644 --- a/packages/schema/test/hooks.test.ts +++ b/packages/schema/test/hooks.test.ts @@ -159,8 +159,8 @@ describe('@feathersjs/schema/hooks', () => { userId: 0, id: 0, user: { - email: 'hello@feathersjs.com', id: 0, + email: '[redacted]', name: 'hello (hello@feathersjs.com)' } })