Lista Doni Navi

This commit is contained in:
Paolo Arena
2020-03-21 10:28:26 +01:00
parent fbc85ce06a
commit b2696d1898
139 changed files with 463 additions and 80 deletions

8
src/server/models/mailinglist.js Normal file → Executable file
View File

@@ -45,7 +45,9 @@ const MailingListSchema = new Schema({
});
MailingListSchema.statics.getFieldsForSearch = function () {
return ['name', 'surname', 'email']
return [{ field: 'name', type: tools.FieldType.string },
{ field: 'surname', type: tools.FieldType.string },
{ field: 'email', type: tools.FieldType.string }]
};
MailingListSchema.statics.executeQueryTable = function (idapp, params) {
@@ -56,7 +58,7 @@ MailingListSchema.statics.executeQueryTable = function (idapp, params) {
MailingListSchema.statics.findAllIdAppSubscribed = function (idapp) {
const MailingList = this;
const myfind = { idapp, statesub: true, wrongerr: {$ne: true} };
const myfind = { idapp, statesub: true, wrongerr: { $ne: true } };
// Extract only the Teacher where in the users table the field permissions is set 'Teacher' bit.
@@ -78,7 +80,7 @@ MailingListSchema.statics.getnumSent = async function (idapp, idmailinglist) {
MailingListSchema.statics.isOk = async function (idapp, iduser, idmailinglist) {
const MailingList = this;
const myfind = { idapp, _id: iduser, statesub: true, lastid_newstosent: {$ne: idmailinglist } };
const myfind = { idapp, _id: iduser, statesub: true, lastid_newstosent: { $ne: idmailinglist } };
// Extract only the Teacher where in the users table the field permissions is set 'Teacher' bit.