Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

validator isnt returning anything #3

Open
devSarry opened this issue Jan 26, 2017 · 1 comment
Open

validator isnt returning anything #3

devSarry opened this issue Jan 26, 2017 · 1 comment

Comments

@devSarry
Copy link

My user/hooks/index.js file looks like this

const validateHook = require('feathers-validate-hook')

// Define schema
const schema = {
  required: true,
  type: 'object',
  properties: {
    // Required attribute 'text' with type 'string'
    name: {
      required: true,
      type: 'string'
      },
    email: {
      required: true,
      type: 'string'
      }
    }
  }

exports.before = {
  all: [],
  find: [
    // auth.verifyToken(),
    // auth.populateUser(),
    // auth.restrictToAuthenticated()
  ],
  get: [
    auth.verifyToken(),
    auth.populateUser(),
    auth.restrictToAuthenticated(),
    auth.restrictToOwner({ ownerField: 'id' })
  ],
  create: [
    auth.hashPassword(),
    validateHook(schema)
  ],

This is the error im getting in my client when trying to use the validator

Cannot read property 'map' of null
    at Object.<anonymous> (/home/vagrant/Code/yeller-chat/node_modules/feathers-validate-hook/lib/validate/index.js:25:34)
@rof20004
Copy link

rof20004 commented Jun 2, 2017

How did you correct this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants