mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-07-15 10:25:23 +00:00
finished add community data in scene and automation
This commit is contained in:
@ -238,7 +238,7 @@ export class AutomationService {
|
|||||||
},
|
},
|
||||||
disabled: false,
|
disabled: false,
|
||||||
},
|
},
|
||||||
relations: ['space'],
|
relations: ['space', 'space.community'],
|
||||||
});
|
});
|
||||||
|
|
||||||
// Safe fetch function to handle individual automation fetching
|
// Safe fetch function to handle individual automation fetching
|
||||||
@ -262,6 +262,8 @@ export class AutomationService {
|
|||||||
type: AUTOMATION_TYPE,
|
type: AUTOMATION_TYPE,
|
||||||
spaceId: automation.space.uuid,
|
spaceId: automation.space.uuid,
|
||||||
spaceName: automation.space.spaceName,
|
spaceName: automation.space.spaceName,
|
||||||
|
communityName: automation.space.community.name,
|
||||||
|
communityId: automation.space.community.uuid,
|
||||||
};
|
};
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.warn(
|
console.warn(
|
||||||
|
@ -43,4 +43,6 @@ export interface SceneDetails {
|
|||||||
actions: Action[];
|
actions: Action[];
|
||||||
spaceId: string;
|
spaceId: string;
|
||||||
spaceName: string;
|
spaceName: string;
|
||||||
|
communityName: string;
|
||||||
|
communityId: string;
|
||||||
}
|
}
|
||||||
|
@ -226,7 +226,7 @@ export class SceneService {
|
|||||||
disabled: false,
|
disabled: false,
|
||||||
...(showInHomePage ? { showInHomePage } : {}),
|
...(showInHomePage ? { showInHomePage } : {}),
|
||||||
},
|
},
|
||||||
relations: ['sceneIcon', 'space'],
|
relations: ['sceneIcon', 'space', 'space.community'],
|
||||||
});
|
});
|
||||||
|
|
||||||
const safeFetch = async (scene: any) => {
|
const safeFetch = async (scene: any) => {
|
||||||
@ -494,6 +494,8 @@ export class SceneService {
|
|||||||
actions,
|
actions,
|
||||||
spaceId: spaceUuid,
|
spaceId: spaceUuid,
|
||||||
spaceName: scene.space.spaceName,
|
spaceName: scene.space.spaceName,
|
||||||
|
communityId: scene.space.community.uuid,
|
||||||
|
communityName: scene.space.community.name,
|
||||||
};
|
};
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
if (err instanceof BadRequestException) {
|
if (err instanceof BadRequestException) {
|
||||||
|
Reference in New Issue
Block a user