Files
ostandari/server/models/Links.js
T
2024-10-21 10:22:26 +03:30

21 lines
596 B
JavaScript

const mongoose = require('mongoose');
function image(img) {
if (img) return '/uploads/images/links/' + img
}
const LinksSchema = mongoose.Schema({
title: String,
url : String,
icon : {type: String, get: image , default : null},
index: {type : Number , default : null},
showInHome : {type : Boolean , default : false},
_creator: {type: mongoose.Schema.Types.ObjectId , ref: 'User'},
_updatedBy: {type: mongoose.Schema.Types.ObjectId , ref: 'User'},
siteMap : {type : Boolean , default : false},
modelType : String
});
module.exports = mongoose.model('Links', LinksSchema);