diff --git a/specs/swagger.yml b/specs/swagger.yml index 57d7fb063..871370ee8 100644 --- a/specs/swagger.yml +++ b/specs/swagger.yml @@ -1601,9 +1601,7 @@ paths: '200': description: Success schema: - type: array - items: - $ref: '#/definitions/VolumeMappingRequest' + $ref: '#/definitions/VolumeMappingResponse' headers: X-Timestamp: type: number @@ -2776,6 +2774,13 @@ definitions: accessMode: type: string example: rw + VolumeMappingResponse: + type: object + properties: + volumeMappings: + type: array + items: + $ref: '#/definitions/VolumeMappingRequest' VolumeMappingRequest: type: object properties: diff --git a/src/cli/connector.js b/src/cli/connector.js index 353b698e5..0c56bfb81 100644 --- a/src/cli/connector.js +++ b/src/cli/connector.js @@ -155,7 +155,7 @@ async function _deleteConnector(obj) { } } -async function _getConnectorList(obj) { +async function _getConnectorList() { const list = await ConnectorService.getConnectorList(); logger.info(JSON.stringify(list, null, 2)); logger.info('Connector list has been gotten successfully'); @@ -167,7 +167,7 @@ function _createConnectorObject(cliData) { domain: cliData.domain, publicIp: cliData.publicIp, cert: cliData.cert, - isSelfSignedCert: AppHelper.validateBooleanCliOptions(cliData.selfSignedEnable, cliData.selfSignedDisable), + isSelfSignedCert: AppHelper.validateBooleanCliOptions(cliData.selfSignedOn, cliData.selfSignedOff), devMode: AppHelper.validateBooleanCliOptions(cliData.devModeOn, cliData.devModeOff) }; diff --git a/src/services/connector-service.js b/src/services/connector-service.js index f1a53555b..a2a6a5bae 100644 --- a/src/services/connector-service.js +++ b/src/services/connector-service.js @@ -39,7 +39,7 @@ async function _createConnector(connectorData, transaction) { if (connector) { throw new Errors.ValidationError(ErrorMessages.ALREADY_EXISTS) } - await ConnectorManager.create(connectorData, transaction) + return await ConnectorManager.create(connectorData, transaction) } async function _updateConnector(connectorData, transaction) { diff --git a/src/services/microservices-service.js b/src/services/microservices-service.js index 0aa79ddf9..8fd62b5b6 100644 --- a/src/services/microservices-service.js +++ b/src/services/microservices-service.js @@ -217,14 +217,14 @@ const _deleteMicroservice = async function (microserviceUuid, microserviceData, const microservice = await MicroserviceManager.findOneWithStatus(where, transaction); + if (!microservice) { + throw new Errors.NotFoundError(AppHelper.formatMessage(ErrorMessages.INVALID_MICROSERVICE_UUID, microserviceUuid)); + } if (microservice.microserviceStatus.status === MicroserviceStates.NOT_RUNNING) { - const affectedRows = await MicroserviceManager.delete({ + await MicroserviceManager.delete({ uuid: microserviceUuid }, transaction); - if (affectedRows === 0) { - throw new Errors.NotFoundError(AppHelper.formatMessage(ErrorMessages.INVALID_MICROSERVICE_UUID, microserviceUuid)); - } } else { await MicroserviceManager.update({ uuid: microserviceUuid diff --git a/tests/Controller Testing.postman_collection.json b/tests/Controller Testing.postman_collection.json index b040d08c0..4b593b828 100644 --- a/tests/Controller Testing.postman_collection.json +++ b/tests/Controller Testing.postman_collection.json @@ -3829,11 +3829,12 @@ { "listen": "test", "script": { - "id": "4f7a9f52-12cc-49d0-9e2f-147b6f5cb6fa", + "id": "6d078bca-3762-400b-bf9f-2701f7f5b01b", + "type": "text/javascript", "exec": [ - "tests[\"Status code is 204\"] = responseCode.code === 204;" - ], - "type": "text/javascript" + "tests[\"Status code is 204\"] = responseCode.code === 204;", + "" + ] } } ], @@ -3846,16 +3847,15 @@ }, { "key": "Authorization", - "value": "{{user-token}}", - "type": "text" + "value": "{{user-token}}" } ], "body": { "mode": "raw", - "raw": "" + "raw": "{\n\t\"withCleanup\": false\n}" }, "url": { - "raw": "{{host}}/api/v3/microservices/{{ms-id}}?withCleanUp=true", + "raw": "{{host}}/api/v3/microservices/{{ms-id}}", "host": [ "{{host}}" ], @@ -3864,12 +3864,6 @@ "v3", "microservices", "{{ms-id}}" - ], - "query": [ - { - "key": "withCleanUp", - "value": "true" - } ] } },