- Tweaks
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
const config = require('../config.js');
|
||||
const mongoose = require('mongoose');
|
||||
const timestamps = require('mongoose-timestamp');
|
||||
|
||||
const config = require('../config.js');
|
||||
const Item = require('./item');
|
||||
|
||||
const PostSchema = new mongoose.Schema(
|
||||
{
|
||||
author: String,
|
||||
@@ -133,7 +135,11 @@ const EventSchema = new mongoose.Schema(
|
||||
|
||||
EventSchema.plugin(timestamps);
|
||||
|
||||
EventSchema.path('images').get(v => `${config.assetStoreUrl}${v.url}`)
|
||||
EventSchema.path('images').get(v => `${config.assetStoreUrl}${v.url}`);
|
||||
|
||||
EventSchema.methods.getEventAuctionItems = function(callback = () => {}) {
|
||||
return Item.getAuctionItemsByEvent(this.id, callback);
|
||||
};
|
||||
|
||||
const Event = mongoose.model('Event', EventSchema);
|
||||
module.exports = Event;
|
||||
|
||||
Reference in New Issue
Block a user