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

final correction for number sold logic #53

Closed Doubles-101 closed 3 months ago

Doubles-101 commented 3 months ago

Description of PR that completes issue here...

Bug fix where logic was corrected for filtering number_sold in the browser

Changes

Requests / Responses

Request

GET http://localhost:8000/products?direction=asc&number_sold=1&

Response


[
    {
        "id": 45,
        "name": "Optima",
        "price": 1655.15,
        "number_sold": 1,
        "description": "2008 Kia",
        "quantity": 3,
        "created_date": "2019-05-21",
        "location": "Toronto",
        "image_path": "http://localhost:8000/media/products/vehicle.png",
        "average_rating": 0,
        "store_id": 1
    },
    {
        "id": 50,
        "name": "Golf",
        "price": 653.59,
        "number_sold": 2,
        "description": "1994 Volkswagen",
        "quantity": 4,
        "created_date": "2019-07-10",
        "location": "Berlin",
        "image_path": "http://localhost:8000/media/products/vehicle.png",
        "average_rating": 3.25,
        "store_id": 1
    }
]

## Testing

- Filter by number on the filter section in the browser

## Related Issues

- Fixes #7