updated listing

This commit is contained in:
hannathkadher
2025-01-12 13:40:48 +04:00
parent 4ee4097246
commit 65b7cf1f64
3 changed files with 50 additions and 9 deletions

View File

@ -121,12 +121,27 @@ export class SpaceModelService {
pageable.include =
'subspaceModels,tags,subspaceModels.tags,tags.product,subspaceModels.tags.product';
const queryBuilder = this.spaceModelRepository
const queryBuilder = await this.spaceModelRepository
.createQueryBuilder('spaceModel')
.leftJoinAndSelect('spaceModel.subspaceModels', 'subspaceModels')
.leftJoinAndSelect('spaceModel.tags', 'tags')
.leftJoinAndSelect(
'spaceModel.subspaceModels',
'subspaceModels',
'subspaceModels.disabled = :subspaceDisabled',
{ subspaceDisabled: false },
)
.leftJoinAndSelect(
'spaceModel.tags',
'tags',
'tags.disabled = :tagsDisabled',
{ tagsDisabled: false },
)
.leftJoinAndSelect('tags.product', 'spaceTagproduct')
.leftJoinAndSelect('subspaceModels.tags', 'subspaceModelTags')
.leftJoinAndSelect(
'subspaceModels.tags',
'subspaceModelTags',
'subspaceModelTags.disabled = :subspaceModelTagsDisabled',
{ subspaceModelTagsDisabled: false },
)
.leftJoinAndSelect('subspaceModelTags.product', 'subspaceTagproduct')
.where('spaceModel.disabled = :disabled', { disabled: false })
.andWhere('spaceModel.project = :projectUuid', {
@ -144,6 +159,8 @@ export class SpaceModelService {
queryBuilder,
);
console.log(baseResponseDto);
return new PageResponse<SpaceModelDto>(
baseResponseDto,
paginationResponseDto,

View File

@ -184,11 +184,31 @@ export class SpaceService {
'children.disabled = :disabled',
{ disabled: false },
)
.leftJoinAndSelect('space.incomingConnections', 'incomingConnections')
.leftJoinAndSelect('space.tags', 'tags')
.leftJoinAndSelect(
'space.incomingConnections',
'incomingConnections',
'incomingConnections.disabled = :incomingConnectionDisabled',
{ incomingConnectionDisabled: false },
)
.leftJoinAndSelect(
'space.tags',
'tags',
'tags.disabled = :tagDisabled',
{ tagDisabled: false },
)
.leftJoinAndSelect('tags.product', 'tagProduct')
.leftJoinAndSelect('space.subspaces', 'subspaces')
.leftJoinAndSelect('subspaces.tags', 'subspaceTags')
.leftJoinAndSelect(
'space.subspaces',
'subspaces',
'subspaces.disabled = :subspaceDisabled',
{ subspaceDisabled: false },
)
.leftJoinAndSelect(
'subspaces.tags',
'subspaceTags',
'subspaceTags.disabled = :subspaceTagsDisabled',
{ subspaceTagsDisabled: false },
)
.leftJoinAndSelect('subspaceTags.product', 'subspaceTagProduct')
.where('space.community_id = :communityUuid', { communityUuid })
.andWhere('space.spaceName != :orphanSpaceName', {