allieIsOkay / allieIsOkay/quantified-self-api
Add meal show endpoint
- Ngôn ngữ chính
- JavaScript
- Star
- 0
- Fork
- 0
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
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
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Đánh giá
Issue này chưa được đánh giá.