@@ -56,18 +56,18 @@ export class ApplicationService {
5656
5757 async countApplicationsWithError (
5858 organizationId : number ,
59- whitelist ? : number [ ] | "admin"
59+ whitelist : number [ ] | "admin"
6060 ) : Promise < ApplicationsWithErrorsResponseDto > {
6161 const queryBuilder = this . applicationRepository
6262 . createQueryBuilder ( "app" )
6363 . leftJoin ( "app.iotDevices" , "device" )
6464 . leftJoin ( "app.belongsTo" , "organization" )
6565 . leftJoin ( "device.latestReceivedMessage" , "latestMessage" )
6666 . leftJoin ( "app.dataTargets" , "dataTargets" )
67- . andWhere ( "app.belongsToId = :organizationId" , { organizationId : organizationId } ) ;
67+ . where ( "app.belongsToId = :organizationId" , { organizationId : organizationId } ) ;
6868
6969 if ( whitelist !== "admin" && whitelist . length > 0 ) {
70- queryBuilder . where ( "app.id IN (:...whitelist)" , { whitelist } ) ;
70+ queryBuilder . andWhere ( "app.id IN (:...whitelist)" , { whitelist } ) ;
7171 }
7272
7373 try {
@@ -90,7 +90,7 @@ export class ApplicationService {
9090 }
9191 }
9292
93- async countAllDevices ( organizationId : number , whitelist ? : number [ ] | "admin" ) : Promise < number > {
93+ async countAllDevices ( organizationId : number , whitelist : number [ ] | "admin" ) : Promise < number > {
9494 const queryBuilder = this . applicationRepository
9595 . createQueryBuilder ( "app" )
9696 . leftJoinAndSelect ( "app.iotDevices" , "device" )
@@ -175,7 +175,7 @@ export class ApplicationService {
175175 . andWhere ( "app.belongsToId = :organizationId" , { organizationId : query . organizationId } ) ;
176176
177177 if ( whitelist && whitelist . length > 0 ) {
178- queryBuilder . where ( "app.id IN (:...whitelist)" , { whitelist } ) ;
178+ queryBuilder . andWhere ( "app.id IN (:...whitelist)" , { whitelist } ) ;
179179 }
180180
181181 if ( query . status ) {
0 commit comments