Files
arakrail/api/models/Slider.js
T
Amir Mohamadi bc5e617778 back-end done
2020-12-10 16:36:48 +03:30

27 lines
515 B
JavaScript

const mongoose = require('mongoose')
function image(img) {
return '/uploads/images/slider/' + img
}
const SliderSchema = mongoose.Schema({
image: {type: String, get: image},
slider_details: {
fa: {
title: String,
caption: String
},
en: {
title: String,
caption: String
}
},
created_at: String,
updated_at: String
}, {
toObject: {getters: true},
toJSON: {getters: true}
})
module.exports = mongoose.model('Slider', SliderSchema)