Commit 6bdf9455 authored by dangdoan's avatar dangdoan

clean code

parent 0b674df5
Pipeline #14312 canceled with stages
...@@ -4,11 +4,8 @@ const initSequelize = require('../services/dbServices'); ...@@ -4,11 +4,8 @@ const initSequelize = require('../services/dbServices');
class productProvider { class productProvider {
constructor(skipInitDb) { constructor(skipInitDb) {
if (skipInitDb === true) {
this.db = {};
} else {
this.db = initSequelize this.db = initSequelize
}
} }
async getByCode(code) { async getByCode(code) {
......
This diff is collapsed.
{ {
"name": "nodejstest", "name": "nodejstest",
"version": "1.0.0", "version": "1.0.0",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"test": "node --experimental-vm-modules node_modules/jest/bin/jest.js", "test": "node --experimental-vm-modules node_modules/jest/bin/jest.js",
"start": "node index.js", "start": "node index.js",
"gen-db": "sequelize-auto -o app/models -d inventory -h 127.0.0.1 -u root -p 3306 " "gen-db": "sequelize-auto -o app/models -d inventory -h 127.0.0.1 -u root -p 3306 "
}, },
"dependencies": { "dependencies": {
"axios": "^0.26.1", "axios": "^0.26.1",
"body-parser": "^1.20.0", "body-parser": "^1.20.0",
"change-case": "^4.1.2", "change-case": "^4.1.2",
"cors": "^2.8.5", "cors": "^2.8.5",
"dotenv": "^16.0.0", "dotenv": "^16.0.0",
"express": "^4.17.3", "express": "^4.17.3",
"fs": "^0.0.1-security", "fs": "^0.0.1-security",
"jest": "^27.5.1", "jest": "^27.5.1",
"mysql2": "^2.3.3", "mysql2": "^2.3.3",
"nconf": "^0.11.3", "nconf": "^0.11.3",
"path": "^0.12.7", "path": "^0.12.7",
"require-dir": "^1.2.0", "require-dir": "^1.2.0",
"sequelize-auto": "^0.8.8", "sequelize-auto": "^0.8.8",
"supertest": "^6.2.2", "supertest": "^6.2.2",
"uuid": "^8.3.2" "uuid": "^8.3.2"
}, },
"author": "", "author": "",
"license": "ISC", "license": "ISC",
"description": "" "description": ""
}
\ No newline at end of file }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment