diff --git a/AABrowserAPI/CopySimulator.js b/AABrowserAPI/CopySimulator.js index b6caf92b8..895c7c426 100644 --- a/AABrowserAPI/CopySimulator.js +++ b/AABrowserAPI/CopySimulator.js @@ -106,23 +106,23 @@ exports.newCopySimulator = function newCopySimulator(pStorage) { async function getFileContent(containerName, blobName) { storage.readData[util.promisify.custom] = n => new Promise((resolve, reject) => { - storage.readData(pOrg, pPath, pFile, saveAtCache, (err, pFileContent) => { + storage.readData("AATemplate", containerName, blobName, false, (err, pFileContent) => { if (err.result !== global.DEFAULT_OK_RESPONSE.result) { reject(err) } else { - resolve(JSON.parse(pFileContent)) + resolve(pFileContent) } }) }) let readData = util.promisify(storage.readData) - let fileContent = await readData("AATemplate", containerName, blobName, false) + let fileContent = await readData() return fileContent } async function writeFileContent(teamName, containerName, blobName, content) { storage.writeData[util.promisify.custom] = n => new Promise((resolve, reject) => { - storage.writeData(pOrg, pPath, pFile, pFileContent, (err, value) => { + storage.writeData(teamName, containerName, blobName, content, (err, value) => { if (err.result !== global.DEFAULT_OK_RESPONSE.result) { reject(err) } else { @@ -132,7 +132,7 @@ exports.newCopySimulator = function newCopySimulator(pStorage) { }) let writeData = util.promisify(storage.writeData) - let response = await writeData(teamName, containerName, blobName, content) + let response = await writeData() return response } diff --git a/AABrowserAPI/TeamSetup.js b/AABrowserAPI/TeamSetup.js index 68c9a767b..07113f136 100644 --- a/AABrowserAPI/TeamSetup.js +++ b/AABrowserAPI/TeamSetup.js @@ -6,16 +6,13 @@ initialize: initialize } - let masterAppServerURL; - - let storage; + let masterAppServerURL, storage return thisObject; function initialize(pServerConfig, pStorage) { - - storage = pStorage; - + masterAppServerURL = pServerConfig.masterAppServerURL + storage = pStorage } function newTeam(pTeamCodeName, pTeamDisplayName, pUserName, pBotCodeName, pBotDisplayName, pUserId, callBackFunction) { @@ -599,19 +596,19 @@ } } `, variables, function (req, res) { - if (res.status === 401) { - console.log('[ERROR] TeamSetup -> newTeam -> Error trying to save the session token at the Users Module'); - console.log('[ERROR] TeamSetup -> newTeam -> res.status = 401'); - } - }).then(res => { - if (res.errors) { - console.log('[ERROR] TeamSetup -> newTeam -> Error trying to save the session token at the Users Module'); - console.log('[ERROR] TeamSetup -> newTeam -> res.errors = ' + res.errors); - } - }).catch(error => { - console.log('Error trying to save the session token at the Users Module'); - console.log('[ERROR] TeamSetup -> newTeam -> errors = ' + errors); - }); + if (res.status === 401) { + console.log('[ERROR] TeamSetup -> newTeam -> Error trying to save the session token at the Users Module'); + console.log('[ERROR] TeamSetup -> newTeam -> res.status = 401'); + } + }).then(res => { + if (res.errors) { + console.log('[ERROR] TeamSetup -> newTeam -> Error trying to save the session token at the Users Module'); + console.log('[ERROR] TeamSetup -> newTeam -> res.errors = ' + res.errors); + } + }).catch(error => { + console.log('Error trying to save the session token at the Users Module'); + console.log('[ERROR] TeamSetup -> newTeam -> errors = ' + errors); + }); } catch (err) { @@ -656,7 +653,7 @@ "configFile": "this.bot.config.json" }, { - "repo": "simulator-"+ pBotCodeName + "-Indicator-Bot", + "repo": "simulator-" + pBotCodeName + "-Indicator-Bot", "configFile": "this.bot.config.json" } ], @@ -836,7 +833,7 @@ } - // TODO Fix-Me: this method is trying to remove from the container that was removed by the previous method. + // TODO Fix-Me: this method is trying to remove from the container that was removed by the previous method. // It must remove the files from the aaplatform/team-name folder instead function deleteBotConfig() {