feat: add ci cd files dont edit those files
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
const mongoose = require('mongoose');
|
||||
const mongoosePaginate = require('mongoose-paginate-v2');
|
||||
|
||||
function image(img) {
|
||||
if (img) return '/uploads/images/occasion/' + img
|
||||
}
|
||||
|
||||
const OccasionSchema = mongoose.Schema({
|
||||
title : String,
|
||||
mainCover: {type: String, get: image, default: null},
|
||||
startDate : Date,
|
||||
endDate : Date,
|
||||
index: {type: Number, default: null},
|
||||
publish : {type : Boolean , default: true},
|
||||
status : {type : Boolean , default: false},
|
||||
_creator :{type: mongoose.Schema.Types.ObjectId, ref: 'User'},
|
||||
_updatedBy: {type: mongoose.Schema.Types.ObjectId, ref: 'User'},
|
||||
});
|
||||
|
||||
OccasionSchema.plugin(mongoosePaginate);
|
||||
|
||||
module.exports = mongoose.model('Occasion', OccasionSchema);
|
||||
Reference in New Issue
Block a user