Skip to content

shreyjain1994/feathers-hooks-common2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published