Skip to content
This repository has been archived by the owner on Apr 20, 2018. It is now read-only.

Bundled hooks should support a scope #63

Closed
ekryski opened this issue Mar 30, 2016 · 2 comments
Closed

Bundled hooks should support a scope #63

ekryski opened this issue Mar 30, 2016 · 2 comments

Comments

@ekryski
Copy link
Member

ekryski commented Mar 30, 2016

If you manipulated your result object so that the property you want to remove is not at the root level or inside result.data as an array then it won't be removed. This is the case with auth. We set the response to be:

{
  token: 'token',
  data: {
    email: '[email protected]',
    password: 'password'
  }
}

The password won't be removed when using the current remove hook. Ideally, the response from auth should be:

{
  token: 'token',
  user: {
    email: '[email protected]',
    password: 'password'
  }
}

but because we cannot scope the fields to be removed they still won't be using the remove hook. The same goes for the other hooks that manipulate data.

@ekryski
Copy link
Member Author

ekryski commented May 23, 2016

oops. Accidentally closed.

@daffl
Copy link
Member

daffl commented Nov 12, 2016

feathers-hooks-common now supports this (and v1.6.0 of feathers-hooks which uses hooks-common as its bundled hooks).

@daffl daffl closed this as completed Nov 12, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants