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