createRelated
Create related records in other services.
ts
import { createRelated } from 'feathers-utils/hooks';Type declaration
ts
export interface CreateRelatedOptions<S = Record<string, any>> {
service: keyof S
multi?: boolean
data: (item: any, context: HookContext) => Promisable<Record<string, any>>
}
/**
* Create related records in other services.
*
* @see https://utils.feathersjs.com/hooks/create-related.html
*/
export declare function createRelated<
S = Record<string, any>,
H extends HookContext = HookContext,
>(
options: MaybeArray<CreateRelatedOptions<S>>,
): (context: H, next?: NextFunction) => Promise<void>| Argument | Type | Description |
|---|---|---|
| options | MaybeArray<CreateRelatedOptions<S>> |
| type | methods | multi |
|---|---|---|
| before, around | create | yes |
