- Aggiornato node.js alla versione 22.18.1

- Aggiornato tutti i pacchetti del server all'ultima versione.
- passato mongoose da versione 5 a versione 6
This commit is contained in:
Surya Paolo
2025-03-03 00:46:08 +01:00
parent 45d06b0923
commit 53a70a1c96
120 changed files with 3385 additions and 6065 deletions

View File

@@ -36,9 +36,7 @@ MailingListSchema.statics.findAllIdAppSubscribed = function (idapp) {
// Extract only the Teacher where in the users table the field permissions is set 'Teacher' bit.
return User.find(myfind, (err, arrrec) => {
return arrrec
});
return tools.findAllQueryIdApp(User, myfind);
};
MailingListSchema.statics.getnumSent = async function (idapp, idUser) {
@@ -62,12 +60,9 @@ MailingListSchema.statics.isOk = async function (idapp, iduser, idUser) {
MailingListSchema.statics.findAllIdApp = async function (idapp) {
const myfind = { idapp };
return await User.find(myfind, (err, arrrec) => {
return arrrec
});
return await tools.findAllQueryIdApp(User, myfind);
};
MailingListSchema.statics.isUnsubscribed = async function (idapp, hash) {
@@ -84,15 +79,14 @@ MailingListSchema.statics.findByHash = function (idapp, hash) {
// Extract only the Teacher where in the users table the field permissions is set 'Teacher' bit.
return User.findOne(myfind, (err, rec) => {
return rec
});
return User.findOne(myfind).lean();
};
const MailingList = mongoose.model('MailingList', MailingListSchema);
User.createIndexes((err) => {
if (err) throw err;
});
User.createIndexes()
.then(() => { })
.catch((err) => { throw err; });
module.exports = { MailingList };