mirror of
https://github.com/openmhz/trunk-server.git
synced 2026-11-13 01:07:42 -05:00
Events is functional!!!
Just need to clean some things up and test
This commit is contained in:
@@ -2,18 +2,22 @@ var mongoose = require('mongoose');
|
||||
var {callSchema} = require('./call');
|
||||
console.log(callSchema)
|
||||
|
||||
var groupSchema = mongoose.Schema({
|
||||
var eventSchema = mongoose.Schema({
|
||||
title: String,
|
||||
description: String,
|
||||
expireTime: Number,
|
||||
startTime: Number,
|
||||
endTime: Number,
|
||||
expireTime: Date,
|
||||
startTime: Date,
|
||||
endTime: Date,
|
||||
shortNames: [String],
|
||||
calls: [callSchema]
|
||||
calls: [callSchema],
|
||||
numCalls: Number
|
||||
},
|
||||
{
|
||||
timestamps: true
|
||||
});
|
||||
|
||||
|
||||
module.exports = mongoose.model('Event', groupSchema);
|
||||
// add virtual if You want
|
||||
eventSchema.virtual('callCount').get(function () {
|
||||
return this.calls.length;
|
||||
});
|
||||
module.exports = mongoose.model('Event', eventSchema);
|
||||
|
||||
Reference in New Issue
Block a user