feat: add ci cd files dont edit those files
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
const mongoose = require('mongoose');
|
||||
const mongoosePaginate = require('mongoose-paginate-v2');
|
||||
|
||||
function image(img) {
|
||||
if (img) return '/uploads/images/news/' + img
|
||||
else return '/img/no-cover.jpg'
|
||||
}
|
||||
|
||||
const NewsFileSchema = mongoose.Schema({
|
||||
title: String,
|
||||
description: String,
|
||||
index: {type: Number, default: null},
|
||||
catId: {type: mongoose.Schema.Types.ObjectId, ref: 'Category'},
|
||||
allCat: [{type: mongoose.Schema.Types.ObjectId, ref: 'Category'}],
|
||||
rootParent: {type: mongoose.Schema.Types.ObjectId, ref: 'Category'},
|
||||
showInHome: {type: Boolean, default: true},
|
||||
showInMenu: {type: Boolean, default: false},
|
||||
_creator: {type: mongoose.Schema.Types.ObjectId, ref: 'User'},
|
||||
_updatedBy: {type: mongoose.Schema.Types.ObjectId, ref: 'User'},
|
||||
siteMap: {type: Boolean, default: true},
|
||||
userViews: {type: Number, default: 0},
|
||||
modelType: String,
|
||||
publish: {type: Boolean, default: true},
|
||||
cover: {type: String, get: image, default: null},
|
||||
thumbCover: {type: String, get: image, default: null},
|
||||
});
|
||||
|
||||
NewsFileSchema.plugin(mongoosePaginate);
|
||||
|
||||
|
||||
module.exports = mongoose.model('NewsFile', NewsFileSchema);
|
||||
Reference in New Issue
Block a user