Fixed: le reactions devono stare in una tabella a parte (reactions).
- cambiata la gestione dei seen, fav, book, attend
This commit is contained in:
@@ -20,12 +20,12 @@ const PermissionSchema = new Schema({
|
||||
type: String,
|
||||
default: ''
|
||||
}
|
||||
},{ _id : false });
|
||||
}, { _id: false });
|
||||
|
||||
|
||||
PermissionSchema.pre('save', async function (next) {
|
||||
if (this.isNew) {
|
||||
const myrec = await Permission.findOne().limit(1).sort({_id:-1});
|
||||
const myrec = await Permission.findOne().limit(1).sort({ _id: -1 });
|
||||
if (!!myrec) {
|
||||
if (myrec._doc._id === 0)
|
||||
this._id = 1;
|
||||
@@ -48,7 +48,7 @@ PermissionSchema.statics.executeQueryTable = function (idapp, params) {
|
||||
PermissionSchema.statics.findAllIdApp = async function () {
|
||||
const Permission = this;
|
||||
|
||||
const myfind = { };
|
||||
const myfind = {};
|
||||
|
||||
return await Permission.find(myfind, (err, arrrec) => {
|
||||
return arrrec
|
||||
|
||||
Reference in New Issue
Block a user