Shopping List ============= List of shopping list --------------------- .. http:get:: /api/v1/shopping-lists/ :query to_ckeckin: Filtra por aquellos que no tienen carrito y tienen artículos. **Ejemplo de petición** .. sourcecode:: http GET /api/v1/shopping-lists/ HTTP/1.1 Content-Type: application/json **Ejemplo de respuesta** .. sourcecode:: http HTTP/1.1 200 OK Content-Type: application/json { "count": 1, "next": null, "previous": null, "results": [ { "id": 1, "name": "shopping list 1", "items": [ { "id": 1, "name": "Screws", "quantity": 40, "scanned": false, "created": "2020-03-20T14:10:29.953623Z" }, { "id": 2, "name": "Nuts", "quantity": 25, "scanned": true, "created": "2020-03-21T14:10:29.953623Z" } ], "created": "2020-03-16T14:10:29.953623Z" } ] } Create shopping list -------------------- .. http:post:: /api/v1/shopping-lists/ **Ejemplo de petición** .. sourcecode:: http POST /api/v1/shopping-lists/ HTTP/1.1 Content-Type: application/json { "name": "shopping list 1" } **Ejemplo de respuesta** .. sourcecode:: http HTTP/1.1 201 Created List items from shopping list ----------------------------- .. http:get:: /api/v1/shopping-list-items/ :query shopping_list: Filtra los artículos por ID de lista de compra. **Ejemplo de petición** .. sourcecode:: http GET /api/v1/shopping-list-items/?shopping_list=23 HTTP/1.1 Content-Type: application/json **Ejemplo de respuesta** .. sourcecode:: http HTTP/1.1 200 OK Content-Type: application/json { "count": 1, "next": null, "previous": null, "results": [ { "id": 1, "name": "Screws", "quantity": 40, "scanned": false, "created": "2020-03-20T14:10:29.953623Z" }, { "id": 4, "name": "Nuts", "quantity": 25, "scanned": true, "created": "2020-03-21T14:10:29.953623Z" } ] } Create shopping list item ------------------------- .. http:post:: /api/v1/shopping-list-items/ **Ejemplo de petición** .. sourcecode:: http POST /api/v1/shopping-list-items/ HTTP/1.1 Content-Type: application/json { "shopping_list": 23, "name": "Screws", "quantity": 40, }