Files
2024-10-21 10:22:26 +03:30

27 lines
871 B
JavaScript

const mongoose = require('mongoose');
function image(img) {
if (img) return '/uploads/images/mainCover/' + img
}
const YearBannerSchema = mongoose.Schema({
mainCover: {type: String, get: image, default: null},
iranFlag: {type: Boolean, default: true},
// electionBtn
electionBtn: {type: Boolean, default: true},
// social links
hasEmail: {type: Boolean, default: true},
hasGPlus: {type: Boolean, default: true},
hasTweeter: {type: Boolean, default: true},
hasInstagram: {type: Boolean, default: true},
email: {type: String, default: ''},
gPlus: {type: String, default: ''},
tweeter: {type: String, default: ''},
instagram: {type: String, default: ''},
// textCover : {type : String , default : null},
_updatedBy: {type: mongoose.Schema.Types.ObjectId, ref: 'User'},
});
module.exports = mongoose.model('YearBanner', YearBannerSchema);