- Fixed pagination not refreshing the data...
- Start creating single page of an Event
This commit is contained in:
@@ -29,6 +29,9 @@ const MyEventSchema = new Schema({
|
||||
details: {
|
||||
type: String,
|
||||
},
|
||||
bodytext: {
|
||||
type: String,
|
||||
},
|
||||
dateTimeStart: {
|
||||
type: Date,
|
||||
},
|
||||
|
||||
@@ -31,6 +31,9 @@ const OperatorSchema = new Schema({
|
||||
type: String,
|
||||
trim: true,
|
||||
},
|
||||
usertelegram: {
|
||||
type: String,
|
||||
},
|
||||
cell: {
|
||||
type: String,
|
||||
trim: true,
|
||||
@@ -74,6 +77,18 @@ OperatorSchema.statics.getFieldsForSearch = function () {
|
||||
return ['name', 'surname', 'email', 'cell']
|
||||
};
|
||||
|
||||
OperatorSchema.statics.getEmailByUsername = async function (idapp, username) {
|
||||
const Operator = this;
|
||||
|
||||
return await Operator.findOne({ idapp, username })
|
||||
.then((arrrec) => {
|
||||
return ((arrrec) ? arrrec.email : '');
|
||||
}).catch((e) => {
|
||||
console.error('getEmailByUsername', e);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
OperatorSchema.statics.executeQueryTable = function (idapp, params) {
|
||||
params.fieldsearch = this.getFieldsForSearch();
|
||||
return tools.executeQueryTable(this, idapp, params);
|
||||
|
||||
@@ -40,10 +40,11 @@ SettingsSchema.statics.executeQueryTable = function (idapp, params) {
|
||||
SettingsSchema.statics.getValDbSettings = function (idapp, key) {
|
||||
return Settings.findOne({ idapp, key })
|
||||
.then((myrec) => {
|
||||
console.log('getValDbSettings', myrec, 'idapp', idapp);
|
||||
if (myrec) {
|
||||
if (myrec.type === this.FieldType.date)
|
||||
if (myrec.type === tools.FieldType.date)
|
||||
return myrec.value_date;
|
||||
if (myrec.type === this.FieldType.number)
|
||||
if (myrec.type === tools.FieldType.number)
|
||||
return myrec.value_num;
|
||||
else
|
||||
return myrec.value_str;
|
||||
@@ -52,6 +53,7 @@ SettingsSchema.statics.getValDbSettings = function (idapp, key) {
|
||||
}
|
||||
|
||||
}).catch((err) => {
|
||||
console.error('getValDbSettings', err);
|
||||
return null;
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user