mirror of
https://github.com/strapi/strapi.git
synced 2025-10-30 01:17:28 +00:00
Added missing models key to SubscriberMap and made actions optional.
The `Subscriber` union type of which `SubscriberMap` is a component was missing the optional `models` parameter document here at [#declarative-and-programmatic-usage](https://docs.strapi.io/dev-docs/backend-customization/models#declarative-and-programmatic-usage). I added the optional field by intersecting it with the original type formulation, and also made the `Action` keys optional, since not all of the 18 individual actions should necessarily be specified when making a `SubscriberMap`.
This commit is contained in:
parent
ba1b99b408
commit
96db3913df
@ -3,7 +3,9 @@ import { Event, Action } from '../';
|
||||
type SubscriberFn = (event: Event) => Promise<void> | void;
|
||||
|
||||
type SubscriberMap = {
|
||||
[k in Action]: SubscriberFn;
|
||||
models?: string[],
|
||||
} & {
|
||||
[k in Action]?: SubscriberFn;
|
||||
};
|
||||
|
||||
export type Subscriber = SubscriberFn | SubscriberMap;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user