boolean-uk / team-dev-frontend-client

1 stars 11 forks source link

Fix cohort display in ProfilePage and EditProfile #153

Closed Joelzor closed 1 year ago

Joelzor commented 1 year ago

ProfilePage.js

ProfileEdit.js

dogezen commented 1 year ago

I would suggest you actually send a request for the cohort data, by id.

So that you can then extract the cohort's name, once you fetch it from API.

Finally, the choice of cohort would be better done as a dropdown: you can fetch a list of all cohorts, and display a dropdown with all cohort names. On click of an option, then you assign that option's cohort id as the new cohort for the user.

Joelzor commented 1 year ago

I would suggest you actually send a request for the cohort data, by id.

Could you clarify this? In the API endpoints, we only have an endpoint for getting all cohorts. I'm not sure how we could get a single cohorts data using a user id

dogezen commented 1 year ago

Actually, we forgot to document this endpoint, but you can get a cohort by id: /cohorts/:id