24 lines
459 B
JavaScript
24 lines
459 B
JavaScript
const mongoose = require('mongoose')
|
|
|
|
function image(img) {
|
|
if (img) return '/uploads/images/customer/' + img
|
|
}
|
|
|
|
const CustomerCommentSchema = mongoose.Schema({
|
|
locale: {
|
|
fa: {
|
|
name: String,
|
|
position: String,
|
|
comment: String
|
|
},
|
|
en: {
|
|
name: String,
|
|
position: String,
|
|
comment: String
|
|
}
|
|
},
|
|
image: {type: String, get: image}
|
|
})
|
|
|
|
module.exports = mongoose.model('CustomerComment', CustomerCommentSchema)
|