Fixed: le reactions devono stare in una tabella a parte (reactions).

- cambiata la gestione dei seen, fav, book, attend
This commit is contained in:
Surya Paolo
2023-09-27 18:38:57 +02:00
parent ad6b4c2bfa
commit 142dcadca9
15 changed files with 826 additions and 264 deletions

View File

@@ -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