diff --git a/backend/src/microservices/saas-microservice/data-structures/create-connecttion-for-selfhosted-db.dto.ts b/backend/src/microservices/saas-microservice/data-structures/create-connecttion-for-selfhosted-db.dto.ts index e4492e18f..e1eb5530e 100644 --- a/backend/src/microservices/saas-microservice/data-structures/create-connecttion-for-selfhosted-db.dto.ts +++ b/backend/src/microservices/saas-microservice/data-structures/create-connecttion-for-selfhosted-db.dto.ts @@ -61,4 +61,9 @@ export class CreateConnectionForHostedDbDto { @IsString() @IsNotEmpty() password: string; + + @ApiProperty() + @IsString() + @IsNotEmpty() + hostedDatabaseId: string; } diff --git a/backend/src/microservices/saas-microservice/use-cases/create-connection-for-hosted-db.use.case.ts b/backend/src/microservices/saas-microservice/use-cases/create-connection-for-hosted-db.use.case.ts index 04fdd1081..0f9c7a462 100644 --- a/backend/src/microservices/saas-microservice/use-cases/create-connection-for-hosted-db.use.case.ts +++ b/backend/src/microservices/saas-microservice/use-cases/create-connection-for-hosted-db.use.case.ts @@ -27,7 +27,7 @@ export class CreateConnectionForHostedDbUseCase } protected async implementation(inputData: CreateConnectionForHostedDbDto): Promise { - const { companyId, userId, databaseName, hostname, port, username, password } = inputData; + const { companyId, userId, databaseName, hostname, port, username, password, hostedDatabaseId } = inputData; const connectionAuthor = await this._dbContext.userRepository.findOneUserById(userId); if (!connectionAuthor) { @@ -63,6 +63,7 @@ export class CreateConnectionForHostedDbUseCase await dao.testConnect(); const connection = new ConnectionEntity(); + connection.id = hostedDatabaseId; connection.type = ConnectionTypesEnum.postgres; connection.host = hostname; connection.port = port;