fix prvn errors

This commit is contained in:
Vyacheslav.Sviridov
2022-10-18 20:51:05 +06:00
parent e16cdcdb36
commit d85f4da9b2
4 changed files with 8 additions and 5 deletions

View File

@@ -506,3 +506,5 @@ this.stream.clearLine(1);
1.0.0 - is released 1.0.0 - is released
1.0.2 - Bulk Import added 1.0.2 - Bulk Import added
1.0.5 - Fix AutoProvisioning errors

View File

@@ -29,10 +29,10 @@ async function handleCommand(prvn, command) {
await prvn.newProject() await prvn.newProject()
break break
case '_back': case '_back':
prvn.nodeIndex ? await prvn.getProjects() : await prvn.getProjectData() prvn.nodeId ? await prvn.getProjectData() : await prvn.getProjects()
break break
case '_delete': case '_delete':
prvn.nodeIndex ? await prvn.deleteNode() : await prvn.deleteProject() prvn.nodeId ? await prvn.deleteNode() : await prvn.deleteProject()
break break
case '_status': case '_status':

View File

@@ -57,7 +57,7 @@ async function getProjectData() {
})) }))
this.commands = projectCommands this.commands = projectCommands
this.help = projectCommandsHelp.join('\n ') this.help = projectCommandsHelp.join('\n ')
this.nodeIndex = -1 this.nodeId = null
this.prompt = this.projectId this.prompt = this.projectId
} }
@@ -79,6 +79,7 @@ async function newProject() {
} }
const { data: { id } } = await this.httpClient.request(axiosConfig) const { data: { id } } = await this.httpClient.request(axiosConfig)
console.log(chalk.bgGreen(`Project ${id} created!`)) console.log(chalk.bgGreen(`Project ${id} created!`))
this.projectId = id
await this.getProjectData(id) await this.getProjectData(id)
} }
@@ -100,7 +101,7 @@ async function deleteProject() {
} }
const { statusText } = await this.httpClient.request(axiosConfig) const { statusText } = await this.httpClient.request(axiosConfig)
console.log(chalk.bgGreen(`Delete ${statusText}`)) console.log(chalk.bgGreen(`Delete ${statusText}`))
this.choices = projectsChoices(this.projects) await this.getProjects()
} }

View File

@@ -1,6 +1,6 @@
{ {
"name": "enm-cli", "name": "enm-cli",
"version": "1.0.4b", "version": "1.0.5b",
"description": "This is a cli application for Ericsson Network Manager (ENM)", "description": "This is a cli application for Ericsson Network Manager (ENM)",
"bin": "./bin/enm-cli.js", "bin": "./bin/enm-cli.js",
"scripts": { "scripts": {