Refactor filtering logic in UnitService

This commit is contained in:
faris Aljohari
2024-04-13 18:07:54 +03:00
parent c0e84d80d4
commit 4401b4358c

View File

@ -117,8 +117,9 @@ export class UnitService {
(child) => (child) =>
child.spaceType.type !== 'unit' && child.spaceType.type !== 'unit' &&
child.spaceType.type !== 'floor' && child.spaceType.type !== 'floor' &&
child.spaceType.type !== 'community', child.spaceType.type !== 'community' &&
) // Filter remaining unit and floor and community types child.spaceType.type !== 'unit',
) // Filter remaining unit and floor and community and unit types
.map((child) => ({ .map((child) => ({
uuid: child.uuid, uuid: child.uuid,
name: child.spaceName, name: child.spaceName,
@ -132,8 +133,9 @@ export class UnitService {
(child) => (child) =>
child.spaceType.type !== 'unit' && child.spaceType.type !== 'unit' &&
child.spaceType.type !== 'floor' && child.spaceType.type !== 'floor' &&
child.spaceType.type !== 'community', child.spaceType.type !== 'community' &&
) // Filter remaining unit and floor and community types child.spaceType.type !== 'unit',
) // Filter remaining unit and floor and community and unit types
.map(async (child) => ({ .map(async (child) => ({
uuid: child.uuid, uuid: child.uuid,
name: child.spaceName, name: child.spaceName,