Added order total custom property to order model, included field in order serializer, changed filtered orders to only include completed orders
Changes
Added filter parameter to include only orders that do not have a payment method included. Commented out the code block dealing with query parameters, as we are currently looking for all completed orders from the current user, regardless of their payment type.
Added order total custom property to Order model that sums the order product prices
Added corresponding get_total method to Order serializer, along with a total variable to be returned as a field in the order serializer
Requests / Responses
Request
GET /orders lists all orders, their associated line items, and the total cost of the each order.
[ ] In Postman, perform fetch request to /orders with the authtoken (9ba45f09651c5b0c404f37a2d2572c026c146694) of a user that has closed orders in the database.
Added order total custom property to order model, included field in order serializer, changed filtered orders to only include completed orders
Changes
Requests / Responses
Request
GET
/orders
lists all orders, their associated line items, and the total cost of the each order.Response
HTTP/1.1 200 OK
Testing
Related Issues