Common, reusable hooks for feathers services which are not available in the main feathers-hooks-common respository.
npm install feathers-hooks-common2
disableMultiItemCreate()
source
Prevents the create method from creating multiple resources at once.
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.
- [.joi]
MIT.