allieIsOkay / allieIsOkay/quantified-self-api

Add endpoint for placing food items in meals

Offen
#14 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
JavaScript
Sterne
0
Forks
0
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

As a user,

I should be able to add food items to a meal within the system by submitting a POST request to the endpoint '/api/v1/meals/:meal_id/foods/:id' where :meal_id is the ID of a meal within the system, and :id is the ID of a food within the system.

If a valid request is provided, the application should return a 201 status and a response indicating the food has been added to the meal, formatted as such:
```
{
"message": "Successfully added <% FOOD NAME %> to <% MEAL NAME %>"
}
```

In the event that either the meal or the food could not be found, the application should return a 404 and a message indicating the reason the request failed:
```
{
"message": "Unable to find food"
}
```

- [x] Tested
- [x] Documented

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.