- fix RIS in pendenti, se troppi msg, non compariva piu
- cataloghi, ricerca pickup
This commit is contained in:
@@ -461,7 +461,7 @@ router.post('/import', authenticate, async (req, res) => {
|
||||
name: arrrecauthor[i].trim()
|
||||
}
|
||||
if (arrrecauthor.length > i + 1) {
|
||||
surname = arrrecauthor[i + 1].trim()
|
||||
author.surname = arrrecauthor[i + 1].trim()
|
||||
}
|
||||
arrAuthor.push(author);
|
||||
} catch (e) {
|
||||
@@ -513,18 +513,22 @@ router.post('/import', authenticate, async (req, res) => {
|
||||
}
|
||||
}
|
||||
if (productInfo.publisher) {
|
||||
publisher = productInfo.publisher.trim();
|
||||
// Cerca la Sotto Categoria
|
||||
let recpublisher = await Publisher.findOne({ idapp, name: publisher }).lean();
|
||||
if (!recpublisher) {
|
||||
// Non esiste questo Editore, quindi la creo !
|
||||
recpublisher = new Publisher({ idapp, name: publisher });
|
||||
ris = await recpublisher.save();
|
||||
recpublisher = await Publisher.findOne({ idapp, name: publisher }).lean();
|
||||
}
|
||||
try {
|
||||
publisher = productInfo.publisher.trim();
|
||||
// Cerca la Sotto Categoria
|
||||
let recpublisher = await Publisher.findOne({ idapp, name: publisher }).lean();
|
||||
if (!recpublisher) {
|
||||
// Non esiste questo Editore, quindi la creo !
|
||||
recpublisher = new Publisher({ idapp, name: publisher });
|
||||
ris = await recpublisher.save();
|
||||
recpublisher = await Publisher.findOne({ idapp, name: publisher }).lean();
|
||||
}
|
||||
|
||||
if (recpublisher) {
|
||||
productInfo.idPublisher.push(recpublisher._id);
|
||||
if (recpublisher) {
|
||||
productInfo.idPublisher = recpublisher._id;
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user