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: Member Gyms Color #88

Open Scott-Borecki opened 3 years ago

Scott-Borecki commented 3 years ago

When I visit the gym search page, When I see a gym that I am a member of, the gym card shows as a different color. (or has some indication that I am a member of this gym, whichever is more feasible)

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 says whether the user is a member of the gym or not.

Method in the serializer as something like:

  meta do |gym|
    {
      member:  gym.member?
    }
  end

And then some #member? method in the User or GymMembership model.

And then some conditional in the view to decide which CSS formatting to use for the Gym card.

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