Build an API for grocery list mobile app.
POST /groceries
{
title: "Milk",
category: "Milk based products",
amount: 1
}
201
{
id: 2,
title: "Milk",
category: "Milk based products",
amount: 1,
purchased: false
}
GET /
{}
{ groceries: [ { id: 1, title: "Eggs", category: "General", amount: 12, purchased: false }, { id: 2 title: "Milk", category: "Milk-based products", amount: 1, purchased: true } ] }
PATCH /groceries/2/
{purchased: true}
{
id: 2,
title: "Milk",
category: "Milk based products",
amount: 1,
purchased: true
}