Closed omidmm16 closed 4 years ago
hi @omidmm16 you must change the signature of your method, in your proto file, to allow the new extra field
if I don't need user object, I can get data . but at the same time , I just can use one of them.
rpc SetPassword (SetPasswordInput) returns (SetPasswordRes){}
` @GrpcMethod('UserClient', 'SetPassword')
async setPassword(@GRPCUser user,data:SetPasswordInput, metadata: any): Promisepassword ${metadata.password} - ${metadata.repeatPassword}
,
statusCode: 200,
};
`
what should I do?
thanks
you must change your interface (and proto), for example
interface UserClient {
setPassword(user: any, data: data:SetPasswordInput, metadata: grpc.Metadata): Promise;
}
in proto file signature, we should add only data message, We can't add user decorator in that,
https://github.com/nestjs/docs.nestjs.com/issues/715, https://github.com/nestjs/nest/issues/2596 Nest contributor solves this problem, but I can't do it.
in your mind, what shall we do?
thanks
https://github.com/nestjs/nest/issues/4851 this link can help you? Maybe you may use also a Payload decorator
I didn't see this Issue. with payload, I can get data, and decorator . thank you so much. @mabuonomo.👍 👍 👍
Hi Mr. Buanomo. first thanks for publishing this method. I couldn't get data and user at the same time. but I need both .