File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
src/services/device-management Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -171,8 +171,11 @@ export class ApplicationService {
171171 . leftJoinAndSelect ( "app.belongsTo" , "organization" )
172172 . leftJoinAndSelect ( "device.latestReceivedMessage" , "latestMessage" )
173173 . leftJoinAndSelect ( "app.dataTargets" , "dataTargets" )
174- . leftJoinAndSelect ( "app.controlledProperties" , "controlledProperties" )
175- . andWhere ( "app.belongsToId = :organizationId" , { organizationId : query . organizationId } ) ;
174+ . leftJoinAndSelect ( "app.controlledProperties" , "controlledProperties" ) ;
175+
176+ if ( query . organizationId ) {
177+ queryBuilder . andWhere ( "app.belongsToId = :organizationId" , { organizationId : query . organizationId } ) ;
178+ }
176179
177180 if ( whitelist && whitelist . length > 0 ) {
178181 queryBuilder . andWhere ( "app.id IN (:...whitelist)" , { whitelist } ) ;
You can’t perform that action at this time.
0 commit comments