From 29a2d713526f09439cea02c834450844398d599b Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Mon, 11 Jan 2021 11:12:48 +0100 Subject: [PATCH] Bug Fixed y logging --- Client/httpInterface.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Client/httpInterface.js b/Client/httpInterface.js index fdc397241..fa091ad38 100644 --- a/Client/httpInterface.js +++ b/Client/httpInterface.js @@ -464,18 +464,20 @@ exports.newHttpInterface = function newHttpInterface(WEB_SERVER, DATA_FILE_SERVE } else { if (schemaDocument.updated === true || schemaDocument.created === true) { try { + let created = schemaDocument.created + let updated = schemaDocument.updated schemaDocument.updated = undefined schemaDocument.created = undefined let fileContent = JSON.stringify(schemaDocument, undefined, 4) fs.writeFileSync(filePath + '/' + fileName, fileContent) - if (schemaDocument.created === true) { + if (created === true) { console.log('[SUCCESS] ' + filePath + '/' + fileName + ' created.') - return - } - if (schemaDocument.updated === true) { - console.log('[SUCCESS] ' + filePath + '/' + fileName + ' updated.') - return + } else { + if (updated === true) { + console.log('[SUCCESS] ' + filePath + '/' + fileName + ' updated.') + } } + } catch (err) { console.log('[ERROR] httpInterface -> Docs -> Save -> ' + filePath + '/' + fileName + ' could not be created / updated.') console.log('[ERROR] httpInterface -> Docs -> Save -> Dont worry, the changes are still at the UI, but you will need to do 2 things: 1) Resolve the issue that is preventing the Client to write this file. Look at the error message below as a guide. 2) At the UI, locate this page and edit it with some small change again, so that is flagged that contains changes, otherwise those original changes will be ignored by the Client during the next docs.save command execution.')