- Generazione della Raccolta dei Cataloghi (web e Stampa), e creazione del PDF Online.

- Lista Raccolta Cataloghi, aggiungi/togli catalogo.
This commit is contained in:
Surya Paolo
2025-05-14 15:02:21 +02:00
parent ee3846159c
commit b2c19801e6
7 changed files with 252 additions and 13 deletions

View File

@@ -251,6 +251,28 @@ CatalogSchema.statics.findAllIdApp = async function (idapp) {
}
};
CatalogSchema.statics.executeQueryPickup = async function (idapp, params) {
const strfind = params.search;
if (strfind === '') {
return [];
}
// Cerca title
const reg = new RegExp(strfind, 'i');
const arrrec = await this.find({
idapp,
title: reg,
})
.sort({ title: 1 })
.limit(10)
.select('title _id')
.lean();
return arrrec;
};
const Catalog = mongoose.model('Catalog', CatalogSchema);
Catalog.createIndexes()