day-cohort-70 / bangazon-api-i-like-planes-api

bangazon-api-i-like-planes-api created by GitHub Classroom
1 stars 0 forks source link

POST to profile/cart no longer decrements product.quantity #61

Closed Justin-Acosta closed 3 months ago

Justin-Acosta commented 3 months ago

Changes

profile.py in views: 'POST' to profile/cart no longer decrements product.quantity

Requests / Responses

Request

POST /profile/cart adds product to cart

{
    "product_id": <product_id>
}

Response

HTTP/1.1 201 OK

{
    "id": 34,
    "product": {
        "id": 40,
        "name": "Golf",
        "price": 653.59,
        "number_sold": 0,
        "description": "1994 Volkswagen",
        "quantity": 2,
        "created_date": "2019-07-10",
        "location": "Berlin",
        "image_path": "http://localhost:8000/media/products/vehicle.png",
        "average_rating": null,
        "store_id": 1
    }
}

Related Issues