moleculer-decorators
moleculer-decorators copied to clipboard
fix issue when using constructor with custom arguments
Problem: When i use constructor with some custom arguments like this:
@Service({
name: 'hello-service',
constructOverride: false,
})
class HelloService extends moleculer.Service {
constructor(broker: ServiceBroker, private readonly param1: string, private readonly param2: string) {
super(broker);
}
@Action({
name: 'say.hello',
})
async sayHello() {
return 'Hello!';
}
}
any additional parameters are lost because only 2 parameters are passed to the superclass.