We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Often it is quite handy to post an array of categories in one request instead of eg. 5 seperate requests. This valdiation prevents this: https://github.com/BestBuy/api-playground/blob/master/src/hooks/validate-schema.js#L17-L26
This is possible in a standard feathers app:
const players = _map(this.players, player => { return { name: player.name, teamId: team.id } }) http.post('/players', players) .then((result) => { this.$router.push({name: 'play', params: {teamId: team.id}}) })
The text was updated successfully, but these errors were encountered:
This change might work:
const _isArray = require('lodash').isArray; module.exports = function (schema) { return function validateSchema (hook) { let validator = new Ajv({allErrors: true}); let isValid = false; if (_isArray(hook.data)) { for (var dataItem of hook.data) { isValid = validator.validate(schema, dataItem); } } else { isValid = validator.validate(schema, hook.data); } if (!isValid) { let errorMessages = validator.errors.map(formatErrorMessage); let validationErrors = new errors.BadRequest('Invalid Parameters', { errors: errorMessages }); throw validationErrors; } }; };
Sorry, something went wrong.
No branches or pull requests
Often it is quite handy to post an array of categories in one request instead of eg. 5 seperate requests.
This valdiation prevents this: https://github.com/BestBuy/api-playground/blob/master/src/hooks/validate-schema.js#L17-L26
This is possible in a standard feathers app:
The text was updated successfully, but these errors were encountered: