From 4401b4358c331739db6d81a065834108ff195e10 Mon Sep 17 00:00:00 2001 From: faris Aljohari <83524184+farisaljohari@users.noreply.github.com> Date: Sat, 13 Apr 2024 18:07:54 +0300 Subject: [PATCH] Refactor filtering logic in UnitService --- src/unit/services/unit.service.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/unit/services/unit.service.ts b/src/unit/services/unit.service.ts index 4906f7d..6969717 100644 --- a/src/unit/services/unit.service.ts +++ b/src/unit/services/unit.service.ts @@ -117,8 +117,9 @@ export class UnitService { (child) => child.spaceType.type !== 'unit' && child.spaceType.type !== 'floor' && - child.spaceType.type !== 'community', - ) // Filter remaining unit and floor and community types + child.spaceType.type !== 'community' && + child.spaceType.type !== 'unit', + ) // Filter remaining unit and floor and community and unit types .map((child) => ({ uuid: child.uuid, name: child.spaceName, @@ -132,8 +133,9 @@ export class UnitService { (child) => child.spaceType.type !== 'unit' && child.spaceType.type !== 'floor' && - child.spaceType.type !== 'community', - ) // Filter remaining unit and floor and community types + child.spaceType.type !== 'community' && + child.spaceType.type !== 'unit', + ) // Filter remaining unit and floor and community and unit types .map(async (child) => ({ uuid: child.uuid, name: child.spaceName,