Closed tmikeschu closed 7 years ago
@case-eee thanks for setting this up! Super cool docs too!
Also have a separate suggestion for the docs to clarify what status codes would be returned in event of an error for Food.
Similarly, docs for meals could clarify both success and error return values. Looks like meals controller doesn't have error handling, so that could be added.
Thanks y'all! Yup, definitely forgot about the "GET" routes for foods associated with a meal and just getting all the meals. Good point about error handling as well!
I should also rename the current "MealsController" to "MealFoodsController" and create a new "MealsController" for handling the get requests mentioned above.
Thanks y'all for the feedback!
Will the four meal types already be made? It looks like meal mutations are just for adding and removing foods: https://github.com/case-eee/quantified-self-api/blob/master/app/controllers/api/v1/meals_controller.rb#L20
For organizing meal foods, I don't see GET requests for meals and their foods (index), or for a single meal (show). We could maybe just add the meals a food has associated with it and return that in the serializer? https://github.com/case-eee/quantified-self-api/blob/master/app/serializers/food_serializer.rb Students could populate the meal tables based on that. The way the back-end is now, I don't think they have a way to actually fill the meal tables in a way that persists refreshes.