Correction du chemin de création du dossier de projet lors du téléchargement d'images de mesure
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user