aggiornamenti vari. prima di VITE
This commit is contained in:
@@ -1062,9 +1062,11 @@ router.post('/import', authenticate, async (req, res) => {
|
||||
if (!recmacro.isbn) {
|
||||
recmacro.isbn = recrankingisbn.isbn;
|
||||
}
|
||||
// Se Pagine non sono state settate
|
||||
if ((!recmacro.Pagine || recmacro.Pagine === 0) && recrankingisbn.Pagine)
|
||||
recmacro.Pagine = recrankingisbn.Pagine;
|
||||
|
||||
// Se misure non sono state settate
|
||||
if (!recmacro.misure && recrankingisbn.misure) {
|
||||
recmacro.misure = recrankingisbn.misure;
|
||||
}
|
||||
@@ -1194,12 +1196,12 @@ router.post('/import', authenticate, async (req, res) => {
|
||||
|
||||
productInfo.name = productInfo.name.replace(/ - Usato$| - Nuovo$| - Epub$| - Ebook$| - Mobi$| - DVD$| - Streaming$| - Download$/, "");
|
||||
|
||||
const recrankingisbn = await ImportaIsbn.findOne({ sku: product.sku }).lean();
|
||||
|
||||
let reccateg = null;
|
||||
|
||||
if (product.categories) {
|
||||
// Verifica prima se questa categoria è stata aggiornata !
|
||||
const recrankingisbn = await ImportaIsbn.findOne({ sku: product.sku }).lean();
|
||||
if (recrankingisbn && recrankingisbn.DescrArgomento) {
|
||||
|
||||
if (tools.isArray(recrankingisbn.ListaArgomenti) && recrankingisbn.ListaArgomenti.length > 1) {
|
||||
@@ -1346,7 +1348,6 @@ router.post('/import', authenticate, async (req, res) => {
|
||||
product.active = true;
|
||||
}
|
||||
|
||||
|
||||
// Update ProductInfo
|
||||
let risrecInfo = await ProductInfo.findOneAndUpdate({ code: productInfo.code }, { $set: productInfo }, { new: true, upsert: true });
|
||||
if (risrecInfo) {
|
||||
@@ -1427,6 +1428,23 @@ router.post('/import', authenticate, async (req, res) => {
|
||||
variazione.quantita = arrvariazioni[ind].quantita;
|
||||
}
|
||||
|
||||
// *** CONTROLLA SE AGGIORNARE O MENO DETERMINATI CAMPI CHE SONO STATI GIA' SETTATI
|
||||
if (recrankingisbn) {
|
||||
if (product.misure !== recrankingisbn.misure && recrankingisbn.misure) {
|
||||
product.misure = recrankingisbn.misure;
|
||||
}
|
||||
if (product.formato !== recrankingisbn.formato && recrankingisbn.formato) {
|
||||
product.formato = recrankingisbn.formato;
|
||||
}
|
||||
if (product.Pagine !== recrankingisbn.Pagine && recrankingisbn.Pagine) {
|
||||
product.Pagine = recrankingisbn.Pagine;
|
||||
}
|
||||
if (product.Edizione !== recrankingisbn.Edizione && recrankingisbn.Edizione) {
|
||||
product.Edizione = recrankingisbn.Edizione;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
variazione.active = true; // ++ ??
|
||||
variazione.versione = versione;
|
||||
variazione.versione = versione;
|
||||
|
||||
15
src/server/router/articleRoutes.js
Normal file
15
src/server/router/articleRoutes.js
Normal file
@@ -0,0 +1,15 @@
|
||||
const express = require("express");
|
||||
const { getArticlesSalesHandler, exportArticlesSalesByJSON, viewTable, queryTable } = require("../controllers/articleController");
|
||||
const { authenticate } = require("../middleware/authenticate");
|
||||
|
||||
const router = express.Router();
|
||||
|
||||
router.post("/articles-sales", authenticate, getArticlesSalesHandler);
|
||||
|
||||
router.post("/export-articles-sales-json", authenticate, exportArticlesSalesByJSON);
|
||||
|
||||
router.post("/view-table", authenticate, viewTable);
|
||||
router.post("/query", authenticate, queryTable);
|
||||
|
||||
|
||||
module.exports = router;
|
||||
@@ -703,7 +703,7 @@ router.post('/getobj', authenticate_noerror, async (req, res) => {
|
||||
res.status(200).send({ code: server_constants.RIS_CODE_OK, data: ris });
|
||||
|
||||
} catch (e) {
|
||||
console.error(`ERROR getobj ${cmd}: `, e.message);
|
||||
console.error(`ERROR getobj`, e.message);
|
||||
res.status(200).send({ code: server_constants.RIS_CODE_OK, data: [] });
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user