File tree Expand file tree Collapse file tree
backend/src/entities/connection Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -536,10 +536,11 @@ export class ConnectionController {
536536 } ;
537537 try {
538538 await validateCreateConnectionData ( inputData ) ;
539- } catch ( e ) {
539+ } catch ( e : unknown ) {
540+ const err = e as { response ?: { message ?: string } ; message ?: string } ;
540541 return {
541542 result : false ,
542- message : e ?. response ?. message || e ?. message || Messages . CONNECTION_TYPE_INVALID ,
543+ message : err ?. response ?. message || err ?. message || Messages . CONNECTION_TYPE_INVALID ,
543544 } ;
544545 }
545546 const result = await this . testConnectionUseCase . execute ( inputData , InTransactionEnum . OFF ) ;
Original file line number Diff line number Diff line change @@ -7,6 +7,8 @@ import { UserEntity } from '../../user/user.entity.js';
77import { buildFoundUserDto } from '../../user/utils/build-found-user.dto.js' ;
88import { IFindUsersInConnection } from './use-cases.interfaces.js' ;
99
10+ type UserWithoutRelations = Omit < UserEntity , 'connections' | 'groups' > ;
11+
1012@Injectable ( )
1113export class FindAllUsersInConnectionUseCase
1214 extends AbstractUseCase < string , Array < FoundUserDto > >
@@ -20,10 +22,8 @@ export class FindAllUsersInConnectionUseCase
2022 }
2123
2224 protected async implementation ( connectionId : string ) : Promise < Array < FoundUserDto > > {
23- const userInConnection = await this . _dbContext . userRepository . findAllUsersInConnection ( connectionId ) ;
24- return userInConnection . map ( ( user ) => {
25- //todo fix type after repository types are fixed
26- return buildFoundUserDto ( user as UserEntity ) ;
27- } ) ;
25+ const userInConnection : UserWithoutRelations [ ] =
26+ await this . _dbContext . userRepository . findAllUsersInConnection ( connectionId ) ;
27+ return userInConnection . map ( ( user ) => buildFoundUserDto ( user as UserEntity ) ) ;
2828 }
2929}
Original file line number Diff line number Diff line change @@ -85,7 +85,7 @@ export class FindOneConnectionUseCase
8585 if ( filteredConnection . masterEncryption && inputData . masterPwd && accessLevel !== AccessLevelEnum . none ) {
8686 try {
8787 filteredConnection = Encryptor . decryptConnectionCredentials ( connection , inputData . masterPwd ) ;
88- } catch ( e ) {
88+ } catch ( e : unknown ) {
8989 console . error ( '-> Error decrypting connection credentials' , e ) ;
9090 throw new HttpException (
9191 {
You can’t perform that action at this time.
0 commit comments