Merge pull request #321 from SyncrowIOT/add-community-in-get-scenes-and-automation

finished add community data in scene and automation
This commit is contained in:
faris Aljohari
2025-03-21 09:46:02 +03:00
committed by GitHub
3 changed files with 8 additions and 2 deletions

View File

@ -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(

View File

@ -43,4 +43,6 @@ export interface SceneDetails {
actions: Action[];
spaceId: string;
spaceName: string;
communityName: string;
communityId: string;
}

View File

@ -226,7 +226,7 @@ export class SceneService {
disabled: false,
...(showInHomePage ? { showInHomePage } : {}),
},
relations: ['sceneIcon', 'space'],
relations: ['sceneIcon', 'space', 'space.community'],
});
const safeFetch = async (scene: any) => {
@ -492,6 +492,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) {