25 lines
446 B
JavaScript
25 lines
446 B
JavaScript
const mongoose = require('mongoose')
|
|
|
|
function image(img) {
|
|
return '/uploads/images/team/' + img
|
|
}
|
|
|
|
const TeamSchema = mongoose.Schema({
|
|
locale: {
|
|
fa: {
|
|
first_name: String,
|
|
last_name: String,
|
|
position: String
|
|
},
|
|
en: {
|
|
first_name: String,
|
|
last_name: String,
|
|
position: String
|
|
}
|
|
},
|
|
image: {type: String, get: image},
|
|
index: Number
|
|
})
|
|
|
|
module.exports = mongoose.model('Team', TeamSchema)
|