I have this code:
get_users('GET', []) ->
Users = boss_db:find(consumer, []),
{json, [{users, Users}]}.
But my users
contains for example password
field which I don't want to render. How to exclude some fields from rendring?
I have this code:
get_users('GET', []) ->
Users = boss_db:find(consumer, []),
{json, [{users, Users}]}.
But my users
contains for example password
field which I don't want to render. How to exclude some fields from rendring?
I'm not familiar with ChicagoBoss at all. What's the data type for the return value of the boss_db:find/2
function? Assuming Users
is a list of records, I guess you could do something like:
Users0 = boss_db:find(consumer, []),
Users = [U#user{password = ""}|| U <- Users0],
{json, [{users, Users}]}.