This commit is contained in:
@@ -1,5 +1,9 @@
|
||||
const mongoose = require('mongoose')
|
||||
|
||||
function image(img) {
|
||||
if (img) return '/uploads/images/announcement/' + img
|
||||
}
|
||||
|
||||
const AnnouncementSchema = mongoose.Schema({
|
||||
title: String,
|
||||
caption: String,
|
||||
@@ -7,6 +11,7 @@ const AnnouncementSchema = mongoose.Schema({
|
||||
expireDate: Number,
|
||||
expired: { type: Boolean, default: false },
|
||||
isForAgents: { type: Boolean, default: false },
|
||||
image: { type: String, get: image },
|
||||
_creator: { type: mongoose.ObjectId, ref: 'User' }
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user