Files
arakrail/api/models/AboutPageContent.js
T
2020-11-23 19:39:26 +03:30

93 lines
2.4 KiB
JavaScript

const mongoose = require('mongoose')
function image(img) {
return '/uploads/images/about/' + img
}
const AboutPageSchema = mongoose.Schema({
aboutPage_details: {
fa: {
page_title: String,
s1_title: String,
s1_caption: String,
s2_title: String,
s2_caption: String,
s2_imageCaption: String,
s3_title: String,
s3_caption: String,
s3_imageCaption: String,
s4_text: String,
last_section_title: String,
last_section_text: String
},
en: {
page_title: String,
s1_title: String,
s1_caption: String,
s2_title: String,
s2_caption: String,
s2_imageCaption: String,
s3_title: String,
s3_caption: String,
s3_imageCaption: String,
s4_text: String,
last_section_title: String,
last_section_text: String
},
de: {
page_title: String,
s1_title: String,
s1_caption: String,
s2_title: String,
s2_caption: String,
s2_imageCaption: String,
s3_title: String,
s3_caption: String,
s3_imageCaption: String,
s4_text: String,
last_section_title: String,
last_section_text: String
},
tr: {
page_title: String,
s1_title: String,
s1_caption: String,
s2_title: String,
s2_caption: String,
s2_imageCaption: String,
s3_title: String,
s3_caption: String,
s3_imageCaption: String,
s4_text: String,
last_section_title: String,
last_section_text: String
},
it: {
page_title: String,
s1_title: String,
s1_caption: String,
s2_title: String,
s2_caption: String,
s2_imageCaption: String,
s3_title: String,
s3_caption: String,
s3_imageCaption: String,
s4_text: String,
last_section_title: String,
last_section_text: String
}
},
page_hero: {type: String, get: image},
s2_image: {type: String, get: image},
s3_image: {type: String, get: image},
last_section_image: {type: String, get: image},
created_at: String,
updated_at: String
}, {
toObject: {getters: true},
toJSON: {getters: true}
})
module.exports = mongoose.model('AboutPageContent', AboutPageSchema)