课程: Databases for Node.js Developers (2021)
今天就学习课程吧!
今天就开通帐号,24,700 门业界名师课程任您挑!
Add order management
- [Instructor] All that is left to do now to finalize the order management is to use the order service in our routes. So for that, I first go into server routes, basket index.js, so this is the basket page, and there we already bring in the order service and instantiated in that line, and if I scroll down all the way to see that here we have the route for actually buying the contents of this basket. So let's remove the return statement and the comments here and also remove the next argument and first in line 69, I'm checking if there is a current user, if not, something is wrong, the user should not be on this page, so I redirect and provide a warning. Otherwise I will get user at the end, user from the current user and then I instantiate the basket for this given user and get all the basket items in line 82. If there are no basket items, I throw an error, because if that happens, I should not be on this page…
内容
-
-
-
-
-
-
-
(已锁定)
When to use relational databases59 秒
-
(已锁定)
Set up MySQL3 分钟 20 秒
-
(已锁定)
Create a database schema4 分钟 17 秒
-
(已锁定)
Use Node.js with MySQL9 分钟 58 秒
-
(已锁定)
Introduction to Sequelize2 分钟 4 秒
-
(已锁定)
Add MySQL and Sequelize to your project6 分钟 28 秒
-
(已锁定)
Review the database design2 分钟
-
(已锁定)
Create sequelize models8 分钟 51 秒
-
(已锁定)
Review the auto-generated database structure2 分钟 20 秒
-
(已锁定)
Implement an order service8 分钟 29 秒
-
(已锁定)
Add order management7 分钟 13 秒
-
(已锁定)
-