Open devSarry opened 7 years ago
My user/hooks/index.js file looks like this
user/hooks/index.js
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)
How did you correct this?
My
user/hooks/index.js
file looks like thisconst validateHook = require('feathers-validate-hook')
This is the error im getting in my client when trying to use the validator