diff --git a/apps/drec-api/src/pods/device/device.service.ts b/apps/drec-api/src/pods/device/device.service.ts index 200366393..1b22b42e1 100755 --- a/apps/drec-api/src/pods/device/device.service.ts +++ b/apps/drec-api/src/pods/device/device.service.ts @@ -137,10 +137,10 @@ export class DeviceService { pagenumber: number, ): Promise { this.logger.verbose(`With in getOrganizationDevices`); - if (pagenumber === null || pagenumber === undefined) { - pagenumber = 1; - } - if (Object.keys(filterDto).length != 0) { + if ( + Object.keys(filterDto).length != 0 && + (pagenumber != null || pagenumber != undefined) + ) { const limit = 20; const query = await this.getFilteredQuery(filterDto); let where: any = query.where;