allieIsOkay / allieIsOkay/quantified-self-api

Add meal show endpoint

Open
#10 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
0
Forks
0
PR merge metrics
No merged PRs in 30d

Description

As a user,

I should be able to request the information for a specific meal in the system by submitting a GET request to the endpoint '/api/v1/meals/:meal_id/foods' where :meal_id is the ID of a meal in the system.

A valid response should carry a 200 status code and be formatted as follows:
```
{
"id": 1,
"name": "Breakfast",
"foods": [
{
"id": 1,
"name": "Banana",
"calories": 150
},
{
"id": 6,
"name": "Yogurt",
"calories": 550
},
{
"id": 12,
"name": "Apple",
"calories": 220
}
]
}

```

In the event that an invalid meal id is provided, the response should carry a 404 status, and indicate that the meal was not found:
```
{
"error": "Meal not found"
}
```
- [x] Tested
- [x] Documented

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.