NestJS · Middle · Question 25 of 75
What does @Expose({ groups: ['admin'] }) with ClassSerializerInterceptor allow?
- 1Logging the field
- 2Exposing the route publicly
- ✓Correct answer: Showing some fields only when serializing with a given group, e.g. extra fields for admins
Explanation
Set the groups per route with @SerializeOptions({ groups: [...] }).