checkMulti
See also: isMulti
Check if the 'multi' option is set for a method. You can use this to early throw an error if 'multi' is not set.
ts
import { checkMulti } from 'feathers-utils/hooks';Type declaration
ts
export type CheckMultiOptions = {
/**
* Customize the error that is thrown if the service does not allow multi operations.
*
* If not provided, throws a `MethodNotAllowed` error with a message indicating the operation.
*/
error?: (context: HookContext) => FeathersError
}
/**
* Check if the 'multi' option is set for a method. You can use this to early throw an error if 'multi' is not set.
*
* @see https://utils.feathersjs.com/hooks/check-multi.html
*/
export declare function checkMulti<H extends HookContext = HookContext>(
options?: CheckMultiOptions,
): (context: H, next?: NextFunction) => any| Argument | Type | Description |
|---|---|---|
| options | CheckMultiOptions |
| type | methods | multi |
|---|---|---|
| before, around | create, patch, remove | yes |
