Ajouter la gestion des erreurs lors de la conversion de la chaîne d'identifiants en tableau dans getPathList
This commit is contained in:
@@ -92,9 +92,17 @@ async function getPathFromIds(projectId, orderId) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function getPathList(IdList, projectId) {
|
async function getPathList(IdList, projectId) {
|
||||||
console.log(IdList);
|
// Convertir la chaîne de caractères en tableau
|
||||||
|
let parsedIdList;
|
||||||
|
try {
|
||||||
|
parsedIdList = JSON.parse(IdList);
|
||||||
|
} catch (e) {
|
||||||
|
console.error("Erreur lors de la conversion de la chaîne en tableau:", e);
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(parsedIdList);
|
||||||
const pathList = [];
|
const pathList = [];
|
||||||
const parsedIdList = IdList.map(id => parseInt(id, 10));
|
|
||||||
for (const orderId of parsedIdList) {
|
for (const orderId of parsedIdList) {
|
||||||
console.log(orderId);
|
console.log(orderId);
|
||||||
const path = await getPathFromIds(projectId, orderId);
|
const path = await getPathFromIds(projectId, orderId);
|
||||||
@@ -104,6 +112,7 @@ async function getPathList(IdList, projectId) {
|
|||||||
return pathList;
|
return pathList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export {
|
export {
|
||||||
uploadMeasureImage,
|
uploadMeasureImage,
|
||||||
addMeasureToProject,
|
addMeasureToProject,
|
||||||
|
|||||||
Reference in New Issue
Block a user