Replies: 1 comment
-
Okay, turned out, that const Service = class<T = GenericService> {
constructor(daoObject: T) {
Object.assign(this, daoObject);
}
};
export class PaymentServiceProvider implements Provider<BOPaymentMethodServiceService> {
constructor(
@inject('datasources.payment')
protected dataSource: PaymentDataSource = new PaymentDataSource(),
) {}
async value(): Promise<BOPaymentMethodServiceService> {
return getService(this.dataSource).then(
service => new Service(service) as BOPaymentMethodServiceService,
);
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I've been trying to get it to work for days now. Is there any possibility to make global interceptors work with service proxy?
I have service proxy baked by grpc server like this
And global interceptor created
I tried to inject it in controller like
@service(PaymentServiceProvider, { asProxyWithInterceptors: true })
and@inject('services.PaymentService', { asProxyWithInterceptors: true })
, but nothing works. I noticed, that interceptor works fine with providers, but I can't make it working with service proxy. Also, injecting service with@service
decorator also skips interceptor call.Beta Was this translation helpful? Give feedback.
All reactions