diff --git a/common/dbHelper.js b/common/dbHelper.js index dcd740c..f6c008d 100644 --- a/common/dbHelper.js +++ b/common/dbHelper.js @@ -2,7 +2,7 @@ Schema = mongoose.Schema, models = require('./models'); -for (var m in models) { +for(var m in models) { mongoose.model(m, new Schema(models[m])); } module.exports = { diff --git a/common/models.js b/common/models.js index a6bdf4f..6d79093 100644 --- a/common/models.js +++ b/common/models.js @@ -1,21 +1,21 @@ module.exports = { - user: { - name: { type: String, required: true }, - password: { type: String, required: true } - }, - commodity: { - name: String, - price: Number, - imgSrc: String - }, - cart:{ - uId: { type: String }, - cId: { type: String }, - cName: { type: String }, - cPrice: { type: String }, - cImgSrc: { type:String } , - cQuantity: { type: Number }, - cStatus : { type: Boolean, default: false } - } -}; + user: { + name: { type: String, required: true }, + password: { type: String, required: true } + }, + commodity: { + name: String, + price: Number, + imgSrc: String + }, + cart:{ + uId: { type: String }, + cId: { type: String }, + cName: { type: String }, + cPrice: { type: String }, + cImgSrc: { type:String } , + cQuantity: { type: Number }, + cStatus : { type: Boolean, default: false } + } +}