ClassSerializer not working in NestJs with @Res decorator

23 views Asked by At

I want to exclude some fields in my response and I use ClassSerializerInterceptor but it does not work when I use @Res.

Here my entity with @Exclude

enter image description here

Here my controller with @Get

enter image description here

And here my main where I use ClassSerializer global

enter image description here

The photo below is the error that I have in VScode when I call my Api e the responde in Postman is not correct

enter image description here

I have tried also @UseInterceptors(ClassSerializerInterceptor) above the @Get call but I have the same issue and the field password is still present

0

There are 0 answers