added disabled check

This commit is contained in:
hannathkadher
2025-03-13 14:03:59 +04:00
parent 8b3232b2f4
commit d24b1d88d7
2 changed files with 6 additions and 6 deletions

View File

@ -144,7 +144,7 @@ export class SubspaceDeviceService {
// Helper method to find subspace with devices relation
private async findSubspaceWithDevices(subSpaceUuid: string) {
const subspace = await this.subspaceRepository.findOne({
where: { uuid: subSpaceUuid },
where: { uuid: subSpaceUuid, disabled: false },
relations: ['devices', 'devices.productDevice'],
});
if (!subspace) {
@ -155,7 +155,7 @@ export class SubspaceDeviceService {
private async findSubspace(subSpaceUuid: string) {
const subspace = await this.subspaceRepository.findOne({
where: { uuid: subSpaceUuid },
where: { uuid: subSpaceUuid, disabled: false },
});
if (!subspace) {
this.throwNotFound('Subspace', subSpaceUuid);

View File

@ -187,7 +187,7 @@ export class SubSpaceService {
try {
pageable.modelName = 'subspace';
pageable.where = { space: { uuid: spaceUuid } };
pageable.where = { space: { uuid: spaceUuid }, disabled: false };
const customModel = TypeORMCustomModel(this.subspaceRepository);
const { baseResponseDto, paginationResponseDto } =
@ -212,7 +212,7 @@ export class SubSpaceService {
spaceUuid,
);
const subSpace = await this.subspaceRepository.findOne({
where: { uuid: subSpaceUuid },
where: { uuid: subSpaceUuid, disabled: false },
});
if (!subSpace) {
@ -252,7 +252,7 @@ export class SubSpaceService {
);
const subspace = await this.subspaceRepository.findOne({
where: { uuid: subSpaceUuid },
where: { uuid: subSpaceUuid, disabled: false },
});
if (!subspace) {
@ -506,7 +506,7 @@ export class SubSpaceService {
private async findOne(subspaceUuid: string): Promise<SubspaceEntity> {
const subspace = await this.subspaceRepository.findOne({
where: { uuid: subspaceUuid },
where: { uuid: subspaceUuid, disabled: false },
relations: ['tags', 'space', 'devices', 'tags.product', 'tags.device'],
});
if (!subspace) {