back-end done

This commit is contained in:
Amir Mohamadi
2020-12-10 16:36:48 +03:30
parent 80a7abafb7
commit bc5e617778
92 changed files with 5217 additions and 3379 deletions
+2 -25
View File
@@ -1,39 +1,16 @@
const mongoose = require('mongoose')
function image(img) {
return '/uploads/images/products/category/' + img
}
const ProductCategorySchema = mongoose.Schema({
image: {type: String, get: image},
cover: {type: String, get: image},
category_details: {
fa: {
name: String,
caption: String
name: String
},
en: {
name: String,
caption: String
},
de: {
name: String,
caption: String
},
tr: {
name: String,
caption: String
},
it: {
name: String,
caption: String
name: String
}
},
created_at: String,
updated_at: String
}, {
toObject: {getters: true},
toJSON: {getters: true}
})
module.exports = mongoose.model('ProductCategory', ProductCategorySchema)