Creating an order
So far, users can add/remove products from the cart, and go to a checkout page. Now we need to implement the actual checkout functionality. Using HTTP POST,
we can send all the cart information to the backend to create an order. Let's create a new API call for the orders:
yo angular-fullstack:endpoint order ? What will the url of your endpoint be? /api/orders create server/api/order/order.controller.js create server/api/order/order.events.js create server/api/order/order.integration.js create server/api/order/order.model.js create server/api/order/order.socket.js create server/api/order/index.js create server/api/order/index.spec.js
The preceding command will create all the scaffolding code needed to CRUD orders.
Modifying ...
Get Web Application Development with MEAN now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.