From 5119ee488a7f7d961fc325e2f567b762508734a8 Mon Sep 17 00:00:00 2001 From: Kerboul Date: Tue, 11 Feb 2025 16:59:43 +0100 Subject: [PATCH] =?UTF-8?q?Correction=20du=20chemin=20de=20cr=C3=A9ation?= =?UTF-8?q?=20du=20dossier=20de=20projet=20lors=20du=20t=C3=A9l=C3=A9charg?= =?UTF-8?q?ement=20d'images=20de=20mesure?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/measure/measureManager.js | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/src/measure/measureManager.js b/src/measure/measureManager.js index 024cbc5..e8a95d2 100644 --- a/src/measure/measureManager.js +++ b/src/measure/measureManager.js @@ -3,16 +3,9 @@ import path from 'path'; import storageManager from '../data/storageManager.js'; async function uploadMeasureImage(image, projectId, orderId) { - // Create the project directory if it doesn't exist - const projectDir = storageManager.createFolder(projectId.toString()); - - // Create the images directory within the project directory + const projectDir = storageManager.createFolder('./storage/' + projectId.toString()); const imagesDir = storageManager.createFolder(path.join(projectDir, 'images')); - - // Define the path where the image will be saved - const imagePath = path.join(imagesDir, `${orderId}.jpg`); - - // Save the uploaded image to the defined path + var imagePath = path.join(imagesDir, `${orderId}.jpg`); storageManager.saveFile(imagePath, image.buffer); return imagePath;