mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-07-10 15:17:41 +00:00
added disabled check
This commit is contained in:
@ -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);
|
||||
|
@ -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) {
|
||||
|
Reference in New Issue
Block a user