day-cohort-70 / Bangazon-API-BandyChamps

0 stars 0 forks source link

fixed get user and divide by zero bugs #44

Closed nicholas-davison closed 1 month ago

nicholas-davison commented 1 month ago

Changes

Requests / Responses

Request

GET /profile requests a user profile

Response

        HTTP/1.1 200 OK
        {
            "id": 7,
            "url": "http://localhost:8000/customers/7",
            "user": {
                "first_name": "Brenda",
                "last_name": "Long",
                "email": "brenda@brendalong.com"
            },
            "phone_number": "555-1212",
            "address": "100 Indefatiguable Way",
            "payment_types": [
                {
                    "url": "http://localhost:8000/paymenttypes/3",
                    "deleted": null,
                    "merchant_name": "Visa",
                    "account_number": "fj0398fjw0g89434",
                    "expiration_date": "2020-03-01",
                    "create_date": "2019-03-11",
                    "customer": "http://localhost:8000/customers/7"
                }
            ],
            "recommends": [
                {
                    "product": {
                        "id": 32,
                        "name": "DB9"
                    },
                    "customer": {
                        "id": 5,
                        "user": {
                            "first_name": "Joe",
                            "last_name": "Shepherd",
                            "email": "joe@joeshepherd.com"
                        }
                    }
                }
            ]
        }


## Testing

- [ ] send get request to /profile end point in postman
- [ ] log in to Bangazon homepage, both 500 errors should be gone

## Related Issues

- Fixes #39
- Fixes # 40