List Products - MarcoLagalla/marette_backend GitHub Wiki

Name List Products
Description List all products for the restaurant
URL api/v1/webapp/restaurant/<int:id>/products
Allowed methods GET
Authorizations GET (AlloyAny)

GET

Returns the complete details list for all of the products of the restaurant with id: <int:id> Products are returned by category as for FOOD_CATEGORY_CHOICES Anyone can retrieve the details.

N.B here image URLs are filled with placeholders. In production will return the /media/ URL.

{
    "Altro": [],
    "Antipasto": [
        {
            "id": 3,
            "name": "Insalata di cavolo",
            "description": "insalatina",
            "category": "Antipasto",
            "price": "10.00",
            "iva": "22",
            "tags": [
                {
                    "name": "Vegetariano",
                    "icon": null,
                    "description": "cibo vegano"
                }
            ],
            "discounts": [],
            "final_price": 10.0,
            "image": "media/dema.png",
            "thumb_image": "media/thumbs/dema.png",
            "show_image": true,
            "available": true
        }
    ],
    "Contorno": [],
    "Dessert": [],
    "Caffetteria": [],
    "Panetteria": [],
    "Panini e Piadine": [],
    "Pizza": [],
    "Primo": [],
    "Secondo": [
        {
            "id": 20,
            "name": "Vitello Tonnato",
            "description": "vitello",
            "category": "Secondo",
            "price": "8.00",
            "tags": [],
            "discounts": [],
            "final_price": 8.0,
            "image": "placeholder/product/secondo.png",
            "thumb_image": "placeholder/product/thumbs/secondo.jpg",
            "show_image": true,
            "available": true
        }
    ],
    "Snack": []
}

Return codes

Status Description
HTTP_200_OK return restaurant list
HTTP_404_NOT_FOUND no restaurant with the givend id
⚠️ **GitHub.com Fallback** ⚠️