mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-11-26 21:24:53 +00:00
merged with space-product
This commit is contained in:
@ -87,6 +87,7 @@ export class SpaceEntity extends AbstractEntity<SpaceDto> {
|
|||||||
type: 'text',
|
type: 'text',
|
||||||
})
|
})
|
||||||
public icon: string;
|
public icon: string;
|
||||||
|
|
||||||
@OneToMany(() => SpaceProductEntity, (spaceProduct) => spaceProduct.space)
|
@OneToMany(() => SpaceProductEntity, (spaceProduct) => spaceProduct.space)
|
||||||
spaceProducts: SpaceProductEntity[];
|
spaceProducts: SpaceProductEntity[];
|
||||||
|
|
||||||
|
|||||||
@ -74,7 +74,12 @@ export class SpaceService {
|
|||||||
// Get all spaces related to the community, including the parent-child relations
|
// Get all spaces related to the community, including the parent-child relations
|
||||||
const spaces = await this.spaceRepository.find({
|
const spaces = await this.spaceRepository.find({
|
||||||
where: { community: { uuid: communityUuid } },
|
where: { community: { uuid: communityUuid } },
|
||||||
relations: ['parent', 'children', 'incomingConnections'], // Include parent and children relations
|
relations: [
|
||||||
|
'parent',
|
||||||
|
'children',
|
||||||
|
'incomingConnections',
|
||||||
|
'spaceProducts',
|
||||||
|
], // Include parent and children relations
|
||||||
});
|
});
|
||||||
|
|
||||||
// Organize spaces into a hierarchical structure
|
// Organize spaces into a hierarchical structure
|
||||||
|
|||||||
Reference in New Issue
Block a user