allieIsOkay / allieIsOkay/quantified-self-api

Add meal show endpoint

Abierto
#10 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
JavaScript
Estrellas
0
Forks
0
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

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

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.