Missing function property on applyModelsEnhanceMap#fields
robertt opened this issue · comments
In the docs, this example is used as a way of overriding the _all
in applyModelsEhnanceMap
:
applyModelsEnhanceMap({
User: {
fields: {
// all fields are protected against unauthorized access
_all: [Authorized()],
// this field has additional decorators to apply
password: [
Extensions({ logMessage: "Danger zone", logLevel: LogLevel.WARN }),
],
// this field is public, no `@Authorized` decorator returned
id: allDecorators => [],
},
},
});
In the generated code, the type definition of the fields property is:
type FieldsConfig<TTypeKeys extends string = string> = Partial<Record<TTypeKeys | "_all", PropertyDecorator[]>>;
Not allowing a function to be passed. Could this be fixed/is there an alternative way of achieving this? Happy to take a stab.