From the course: Databases for Node.js Developers
Unlock this course with a free trial
Join today to access over 25,500 courses taught by industry experts.
Implementing the order admin view - Node.js Tutorial
From the course: Databases for Node.js Developers
Implementing the order admin view
- [Instructor] In our application, managing orders is a crucial part of the admin workflow. In this video, we will now implement to few all orders along with their details, and we will also add a route to mark orders as shipped. So by the end of the video, the admin will have full control over the order management process. Along the way, we will also learn how to join data in relational databases like MySQL using Sequelize. So let's head into Visual Studio Code. And there we are now working in routes, admin, orders.js. And if you wonder how the views look, they are in views, admin, orders.js. So the first thing I'm going to implement now is fetching all orders. So here in line eight, we see that we need all orders. I remove this placeholder now and I will now replace it with a function that fetches all orders, but also the order items and also the users or the use of the customer for this order. So I'll start writing const orders equals and await and do fastify.models.Order.findAll…