mirror of
https://github.com/vvsviridov/enm-cli.git
synced 2025-11-03 13:43:39 +00:00
fix errors
This commit is contained in:
@@ -18,14 +18,15 @@ function operationStatus(type, status) {
|
||||
case 'INVALID':
|
||||
case 'EXECUTION_ERROR':
|
||||
return chalk.red(`❌ ${type}`)
|
||||
|
||||
|
||||
default:
|
||||
return chalk.yellow(`🔎 ${type}`)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
async function getOperations(failures=false) {
|
||||
async function getOperations(failures = false) {
|
||||
this.failures = failures
|
||||
const params = new URLSearchParams()
|
||||
params.append('offset', this.operationsOffset)
|
||||
params.append('limit', this.operationsLimit)
|
||||
@@ -33,7 +34,7 @@ async function getOperations(failures=false) {
|
||||
params.append('expand', 'persistentCurrentAttributes')
|
||||
params.append('expand', 'failures')
|
||||
params.append('expand', 'warnings')
|
||||
if (failures) {
|
||||
if (this.failures) {
|
||||
params.append('status', 'invalid')
|
||||
params.append('status', 'execution-error')
|
||||
}
|
||||
@@ -71,12 +72,13 @@ function setOperationsPagination(href) {
|
||||
}
|
||||
|
||||
|
||||
async function pageOperations(page) {
|
||||
async function pageOperations(command) {
|
||||
const page = command.replace(/_/, '')
|
||||
if (!this.operationsLinks[page]) {
|
||||
throw new Error(`No ${page} jobs❗`)
|
||||
}
|
||||
setOperationsPagination.call(this, this.operationsLinks[page].href)
|
||||
await this.getOperations()
|
||||
await this.getOperations(this.failures)
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user