Fix bug and update

This commit is contained in:
Swift
2023-11-29 22:59:52 +03:30
parent bce43bda11
commit a6a8d6ad5a
25 changed files with 12654 additions and 15098 deletions
+2 -4
View File
@@ -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' }
})