tvaroglu / spot_me_frontend

SpotMe is a 10-day, 6 person project, during Mod 3 of 4 for Turing School's Back End Engineering Program.
https://spotme-app.herokuapp.com
3 stars 1 forks source link

Gym Search: Add number of active members at gym #86

Closed Scott-Borecki closed 3 years ago

Scott-Borecki commented 3 years ago

Might be nice to show on the gym search page how many active members are at the gym.

This should be handled on the backend and then the gym poro could have an attribute added for gym_member_count.

TV 10.8: Going with attribute on this. The serializer is hand-rolled anyways.. no point (IMO) in keying this out as meta when we can just add another attribute.

Note: We could update the Gym Search endpoint to send meta information along with each gym in the GymSerializer.
That meta information would be a hash key that populates the gym member count. Method as something like:

GymMembership.where(yelp_gym_id: yelp_gym_id).size

See @tvaroglu or @Scott-Borecki for help with using meta in the the serializer. Or check out the jsonapi-serializer docs: https://github.com/jsonapi-serializer/jsonapi-serializer#meta-per-resource