- Enable Edit Event into dialog form ... (and save to the db)
- Add Where table
This commit is contained in:
@@ -21,7 +21,7 @@ const bookingSchema = new Schema({
|
||||
type: String,
|
||||
},
|
||||
id_bookedevent: {
|
||||
type: Number,
|
||||
type: String,
|
||||
},
|
||||
numpeople: {
|
||||
type: Number,
|
||||
|
||||
@@ -29,19 +29,10 @@ const MyEventSchema = new Schema({
|
||||
details: {
|
||||
type: String,
|
||||
},
|
||||
withtime: {
|
||||
type: Boolean,
|
||||
dateTimeStart: {
|
||||
type: Date,
|
||||
},
|
||||
dur: {
|
||||
type: Number,
|
||||
},
|
||||
dur2: {
|
||||
type: Number,
|
||||
},
|
||||
days: {
|
||||
type: Number,
|
||||
},
|
||||
date: {
|
||||
dateTimeEnd: {
|
||||
type: Date,
|
||||
},
|
||||
bgcolor: {
|
||||
@@ -56,7 +47,7 @@ const MyEventSchema = new Schema({
|
||||
img: {
|
||||
type: String,
|
||||
},
|
||||
where: {
|
||||
wherecode: {
|
||||
type: String,
|
||||
},
|
||||
contribtype: { // TABLE
|
||||
|
||||
46
server/models/where.js
Normal file
46
server/models/where.js
Normal file
@@ -0,0 +1,46 @@
|
||||
const mongoose = require('mongoose');
|
||||
const Schema = mongoose.Schema;
|
||||
|
||||
const tools = require('../tools/general');
|
||||
|
||||
mongoose.Promise = global.Promise;
|
||||
mongoose.level = "F";
|
||||
|
||||
|
||||
// Resolving error Unknown modifier: $pushAll
|
||||
mongoose.plugin(schema => {
|
||||
schema.options.usePushEach = true
|
||||
});
|
||||
|
||||
const WhereSchema = new Schema({
|
||||
idapp: {
|
||||
type: String,
|
||||
},
|
||||
code: {
|
||||
type: String,
|
||||
},
|
||||
placename: {
|
||||
type: String,
|
||||
},
|
||||
whereicon: {
|
||||
type: String,
|
||||
},
|
||||
});
|
||||
|
||||
WhereSchema.statics.executeQueryTable = function (idapp, params) {
|
||||
return tools.executeQueryTable(this, idapp, params);
|
||||
};
|
||||
|
||||
WhereSchema.statics.findAllIdApp = function (idapp) {
|
||||
const Where = this;
|
||||
|
||||
const myfind = { idapp };
|
||||
|
||||
return Where.find(myfind, (err, arrrec) => {
|
||||
return arrrec
|
||||
});
|
||||
};
|
||||
|
||||
const Where = mongoose.model('Where', WhereSchema);
|
||||
|
||||
module.exports = { Where };
|
||||
Reference in New Issue
Block a user