Is there any way to hide some user attributes conditionally that are returned by sequelize query?

34 Views Asked by At

user profile table have a name, phoneNumber , isPrivate and additional attributes, If user check isPrivate to true, then if other users return any data related to this user the response shouldn't have the name and phoneNumber except the admin and the user himself, another problem is responses are different in structure and user object may be on level one or on another level at response how can I achieve such behaviour?

Tech: (nodejs , sequelize , postgress)

0

There are 0 best solutions below