- Creazione di un Nuovo Catalogo (e la sua relativa pagina), a partire da un modello ed un catalogo esistente.

- Aggiunta dei bottoni sul Ccatalogocard
This commit is contained in:
Surya Paolo
2025-06-12 23:49:18 +02:00
parent 133dc6a502
commit 6b9ddc8986
7 changed files with 557 additions and 439 deletions

View File

@@ -1,5 +1,5 @@
const os = require('os');
const fs = require('fs'); // 👈 Usa il modulo promises
const fs = require('fs-extra'); // 👈 Usa il modulo promises
const xml2js = require('xml2js');
const path = require('path');
const WebSocket = require('ws');
@@ -5762,10 +5762,9 @@ module.exports = {
if (table === 'catalog') {
mydir = 'upload/cataloghi/';
}
}
return mydir;
},
getURLImg(idapp, table, username, img, checkifExist) {
@@ -5773,12 +5772,8 @@ module.exports = {
try {
// let dir = this.getdirByIdApp(idapp) + dirmain + '/' + this.getDirUpload();
let dir =
this.getdirByIdApp(idapp)
'/' +
this.getDirUpload() +
shared_consts.getDirectoryImgByTable(table, username) +
dirmain;
let dir = this.getdirByIdApp(idapp);
'/' + this.getDirUpload() + shared_consts.getDirectoryImgByTable(table, username) + dirmain;
img = dir + img;
@@ -6073,11 +6068,8 @@ module.exports = {
if (aggiornatoimg?.filepath.includes('noimg.jpg')) {
// nascondi il prodotto se non trovo l'immagine !
await Product.updateOne(
{ idProductInfo: productInfo._id },
{ $set: { deleted: true } }
);
await Product.updateOne({ idProductInfo: productInfo._id }, { $set: { deleted: true } });
aggiornatoimg = { ris: false, deleted: true };
}
@@ -6199,7 +6191,16 @@ module.exports = {
},
async attendiNSecondi(numsec) {
await new Promise(resolve => setTimeout(resolve, numsec * 1000));
await new Promise((resolve) => setTimeout(resolve, numsec * 1000));
},
async copyDirectory(sourceDir, destinationDir) {
try {
await fs.copy(sourceDir, destinationDir);
console.log('Directory copiata con successo!');
} catch (err) {
console.error('Errore durante la copia della directory:', err);
}
},
fixFilePath(myfilepath) {