diff --git a/README.md b/README.md index d754176b..5ab520c0 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,8 @@ Fullstack: > [Angular 12 + Node.js Express + MySQL example](https://www.bezkoder.com/angular-12-node-js-express-mysql/) +> [Angular 13 + Node.js Express + MySQL example](https://www.bezkoder.com/angular-13-node-js-express-mysql/) + > [React + Node.js + Express + MySQL example](https://www.bezkoder.com/react-node-express-mysql/) > [React + Redux + Node.js Express + MySQL](https://www.bezkoder.com/react-redux-mysql-crud/) diff --git a/app/models/tutorial.model.js b/app/models/tutorial.model.js index 17dc453f..d7c52ac5 100644 --- a/app/models/tutorial.model.js +++ b/app/models/tutorial.model.js @@ -1,10 +1,10 @@ const sql = require("./db.js"); // constructor -const Tutorial = function(tutorial) { - this.title = tutorial.title; - this.description = tutorial.description; - this.published = tutorial.published; +const Tutorial = ({ title, description, published }) => { + this.title = title; + this.description = description; + this.published = published; }; Tutorial.create = (newTutorial, result) => { diff --git a/package.json b/package.json index ef1deac0..e0a3e025 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "license": "ISC", "dependencies": { "cors": "^2.8.5", - "express": "^4.17.1", - "mysql": "^2.17.1" + "express": "^4.18.1", + "mysql": "^2.18.1" } }