rajaabnadeem / chippdIn

1 stars 0 forks source link

Show users in group #68

Closed StevelandOH closed 3 years ago

StevelandOH commented 3 years ago

Created a new backend get request to the userGroups table and return an object of users that belong to that specific group.

Made the api call directly from the Group component

Created state (not with the store but with useState( )) for an array containing the current groups users.

Made a function that gets called in the Group component useEffect that creates an array containing the response obj from the api call and copies that to the state of the current groups users

I then mapped over that state in the return statement of the group component rendering a list of names of the people who are in the current group... see below

Screen Shot 2021-05-04 at 2.11.19 PM.pdf