Skip to content

Commit 13ba6c7

Browse files
committed
Refactor GetHostedConnectionCredentials implementation to use findOne with query object
1 parent 385da27 commit 13ba6c7

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

backend/src/microservices/saas-microservice/use-cases/get-hosted-connection-credentials.use.case.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ export class GetHostedConnectionCredentialsUseCase
1919
super();
2020
}
2121

22-
protected async implementation(
23-
inputData: GetHostedConnectionCredentialsDto,
24-
): Promise<HostedConnectionCredentialsRO> {
25-
const connection = await this._dbContext.connectionRepository.findOneById(inputData.hostedDatabaseId);
22+
protected async implementation(inputData: GetHostedConnectionCredentialsDto): Promise<HostedConnectionCredentialsRO> {
23+
const connection = await this._dbContext.connectionRepository.findOne({
24+
where: { id: inputData.hostedDatabaseId },
25+
});
2626
if (!connection) {
2727
throw new NotFoundException(Messages.CONNECTION_NOT_FOUND);
2828
}

0 commit comments

Comments
 (0)