26 lines
520 B
JavaScript
26 lines
520 B
JavaScript
const mongoose = require('mongoose')
|
|
|
|
function file(file) {
|
|
if (file) return '/uploads/images/slider/' + file
|
|
}
|
|
|
|
const SlideSchema = mongoose.Schema({
|
|
// locale: {
|
|
// fa: {
|
|
// name: String,
|
|
// position: String,
|
|
// comment: String
|
|
// },
|
|
// en: {
|
|
// name: String,
|
|
// position: String,
|
|
// comment: String
|
|
// }
|
|
// },
|
|
isImage: Boolean,
|
|
image: {type: String, get: file},
|
|
video: {type: String, get: file}
|
|
})
|
|
|
|
module.exports = mongoose.model('Slide', SlideSchema)
|