From e0f73572045d1e67fcc1f4a7f33b8e59960f68e4 Mon Sep 17 00:00:00 2001 From: siiky Date: Thu, 18 Jul 2024 13:00:13 +0100 Subject: [PATCH] refactor: clarify variables and their names --- lib/customers.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/customers.js b/lib/customers.js index bceada84..75bbf875 100644 --- a/lib/customers.js +++ b/lib/customers.js @@ -715,11 +715,11 @@ function updatePhotoCard (id, patch) { function updatePhotos (imagesData, id, dir) { return Promise.resolve(imagesData) - .then(patch => { - if (_.isEmpty(imagesData)) { - return patch - } + .then(imagesData => { const newPatch = {} + if (_.isEmpty(imagesData)) { + return newPatch + } // i.e. ..////idcarddata const dirname = path.join(dir) // create the directory tree if needed