Refactor unit service to remove unnecessary includeSubSpaces parameter

This commit is contained in:
faris Aljohari
2024-04-28 11:39:49 +03:00
parent c376e69e67
commit cd2f496670
2 changed files with 3 additions and 29 deletions

View File

@ -79,7 +79,7 @@ export class UnitService {
getUnitChildDto: GetUnitChildDto,
): Promise<UnitChildInterface> {
try {
const { includeSubSpaces, page, pageSize } = getUnitChildDto;
const { page, pageSize } = getUnitChildDto;
const space = await this.spaceRepository.findOneOrFail({
where: { uuid: unitUuid },
@ -94,12 +94,7 @@ export class UnitService {
where: { parent: { uuid: space.uuid } },
});
const children = await this.buildHierarchy(
space,
includeSubSpaces,
page,
pageSize,
);
const children = await this.buildHierarchy(space, false, page, pageSize);
return {
uuid: space.uuid,