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

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

Bug: Past orders not displaying #49

Closed Sydney-M-Sharp closed 3 days ago

Sydney-M-Sharp commented 3 days ago

Description of PR that completes issue here...

Changes

Requests / Responses

If this PR contains code that defines a new request/response, or changes an existing one, please put the JSON representations here.

Request

GET /order Adds a new line item field called "total_price"

Responce example listed below

{
        "id": 1,
        "url": "http://localhost:8000/orders/1",
        "created_date": "2019-08-16",
        "payment_type": {
            "id": 1,
            "url": "http://localhost:8000/paymenttypes/1",
            "merchant_name": "Visa",
            "account_number": "24ijio68948fj8439",
            "expiration_date": "2020-01-01",
            "create_date": "2019-11-11"
        },
        "customer": "http://localhost:8000/customers/5",
        "lineitems": [],
        "total_price": 0
    },

Testing

Description of how to test code... run GET request for "http://localhost:8000/orders/1" and insure the ""total_price"" field has been added.

Related Issues

Sydney-M-Sharp commented 3 days ago

Updated the api to now filter the orders rather then the client side.