feathers-hooks-common2
v1.0.1
Published
Common, reusable feathers hooks which are not available in feathers-hooks-common.
Downloads
7
Maintainers
Readme
feathers-hooks-common2
Common, reusable hooks for feathers services which are not available in the main feathers-hooks-common respository.
Installation
npm install feathers-hooks-common2
Hooks
disableMultiItemCreate
disableMultiItemCreate()
source
Prevents the create method from creating multiple resources at once.
validateJoi
validateJoi(schema, property, [options])
source
Params
- schema - The Joi schema.
- property string - The property on the hook's context object that will be validated. Dot notation is supported to represent sub-properties (i.e. params.query).
- [options] object
- [.joi] object - The joi library that will be used for validation. This option is provided in case your application requires the use of a particular version of the joi library. Defaults to whatever version is attained with require('joi').
- [.preCompile] boolean - Whether to precompile the joi schema. Precompiling will make subsequent validations faster. Defaults to true.
- [.error] function - The error to throw on validation failure. Defaults to a BadRequest(400) error.
License
MIT.