- Enable Edit Event into dialog form ... (and save to the db)

- Add Where table
This commit is contained in:
Paolo Arena
2019-10-21 20:38:10 +02:00
parent 1a1348c563
commit 570bbf3744
7 changed files with 102 additions and 37 deletions

View File

@@ -21,7 +21,7 @@ const bookingSchema = new Schema({
type: String,
},
id_bookedevent: {
type: Number,
type: String,
},
numpeople: {
type: Number,

View File

@@ -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
View 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 };