From d09bdd1f6e598043398fccb323cc3146e592c81f Mon Sep 17 00:00:00 2001 From: faris Aljohari <83524184+farisaljohari@users.noreply.github.com> Date: Thu, 20 Mar 2025 11:12:37 +0300 Subject: [PATCH] finished add community data in scene and automation --- src/automation/services/automation.service.ts | 4 +++- src/scene/interface/scene.interface.ts | 2 ++ src/scene/services/scene.service.ts | 4 +++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/automation/services/automation.service.ts b/src/automation/services/automation.service.ts index 86831f6..098ae34 100644 --- a/src/automation/services/automation.service.ts +++ b/src/automation/services/automation.service.ts @@ -238,7 +238,7 @@ export class AutomationService { }, disabled: false, }, - relations: ['space'], + relations: ['space', 'space.community'], }); // Safe fetch function to handle individual automation fetching @@ -262,6 +262,8 @@ export class AutomationService { type: AUTOMATION_TYPE, spaceId: automation.space.uuid, spaceName: automation.space.spaceName, + communityName: automation.space.community.name, + communityId: automation.space.community.uuid, }; } catch (error) { console.warn( diff --git a/src/scene/interface/scene.interface.ts b/src/scene/interface/scene.interface.ts index e8573cb..5c569dd 100644 --- a/src/scene/interface/scene.interface.ts +++ b/src/scene/interface/scene.interface.ts @@ -43,4 +43,6 @@ export interface SceneDetails { actions: Action[]; spaceId: string; spaceName: string; + communityName: string; + communityId: string; } diff --git a/src/scene/services/scene.service.ts b/src/scene/services/scene.service.ts index c053385..574b07e 100644 --- a/src/scene/services/scene.service.ts +++ b/src/scene/services/scene.service.ts @@ -226,7 +226,7 @@ export class SceneService { disabled: false, ...(showInHomePage ? { showInHomePage } : {}), }, - relations: ['sceneIcon', 'space'], + relations: ['sceneIcon', 'space', 'space.community'], }); const safeFetch = async (scene: any) => { @@ -494,6 +494,8 @@ export class SceneService { actions, spaceId: spaceUuid, spaceName: scene.space.spaceName, + communityId: scene.space.community.uuid, + communityName: scene.space.community.name, }; } catch (err) { if (err instanceof BadRequestException) {