mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-07-17 03:05:13 +00:00
@ -144,7 +144,7 @@ export class SubspaceDeviceService {
|
|||||||
// Helper method to find subspace with devices relation
|
// Helper method to find subspace with devices relation
|
||||||
private async findSubspaceWithDevices(subSpaceUuid: string) {
|
private async findSubspaceWithDevices(subSpaceUuid: string) {
|
||||||
const subspace = await this.subspaceRepository.findOne({
|
const subspace = await this.subspaceRepository.findOne({
|
||||||
where: { uuid: subSpaceUuid },
|
where: { uuid: subSpaceUuid, disabled: false },
|
||||||
relations: ['devices', 'devices.productDevice'],
|
relations: ['devices', 'devices.productDevice'],
|
||||||
});
|
});
|
||||||
if (!subspace) {
|
if (!subspace) {
|
||||||
@ -155,7 +155,7 @@ export class SubspaceDeviceService {
|
|||||||
|
|
||||||
private async findSubspace(subSpaceUuid: string) {
|
private async findSubspace(subSpaceUuid: string) {
|
||||||
const subspace = await this.subspaceRepository.findOne({
|
const subspace = await this.subspaceRepository.findOne({
|
||||||
where: { uuid: subSpaceUuid },
|
where: { uuid: subSpaceUuid, disabled: false },
|
||||||
});
|
});
|
||||||
if (!subspace) {
|
if (!subspace) {
|
||||||
this.throwNotFound('Subspace', subSpaceUuid);
|
this.throwNotFound('Subspace', subSpaceUuid);
|
||||||
|
@ -187,7 +187,7 @@ export class SubSpaceService {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
pageable.modelName = 'subspace';
|
pageable.modelName = 'subspace';
|
||||||
pageable.where = { space: { uuid: spaceUuid } };
|
pageable.where = { space: { uuid: spaceUuid }, disabled: false };
|
||||||
const customModel = TypeORMCustomModel(this.subspaceRepository);
|
const customModel = TypeORMCustomModel(this.subspaceRepository);
|
||||||
|
|
||||||
const { baseResponseDto, paginationResponseDto } =
|
const { baseResponseDto, paginationResponseDto } =
|
||||||
@ -212,7 +212,7 @@ export class SubSpaceService {
|
|||||||
spaceUuid,
|
spaceUuid,
|
||||||
);
|
);
|
||||||
const subSpace = await this.subspaceRepository.findOne({
|
const subSpace = await this.subspaceRepository.findOne({
|
||||||
where: { uuid: subSpaceUuid },
|
where: { uuid: subSpaceUuid, disabled: false },
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!subSpace) {
|
if (!subSpace) {
|
||||||
@ -252,7 +252,7 @@ export class SubSpaceService {
|
|||||||
);
|
);
|
||||||
|
|
||||||
const subspace = await this.subspaceRepository.findOne({
|
const subspace = await this.subspaceRepository.findOne({
|
||||||
where: { uuid: subSpaceUuid },
|
where: { uuid: subSpaceUuid, disabled: false },
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!subspace) {
|
if (!subspace) {
|
||||||
@ -506,7 +506,7 @@ export class SubSpaceService {
|
|||||||
|
|
||||||
private async findOne(subspaceUuid: string): Promise<SubspaceEntity> {
|
private async findOne(subspaceUuid: string): Promise<SubspaceEntity> {
|
||||||
const subspace = await this.subspaceRepository.findOne({
|
const subspace = await this.subspaceRepository.findOne({
|
||||||
where: { uuid: subspaceUuid },
|
where: { uuid: subspaceUuid, disabled: false },
|
||||||
relations: ['tags', 'space', 'devices', 'tags.product', 'tags.device'],
|
relations: ['tags', 'space', 'devices', 'tags.product', 'tags.device'],
|
||||||
});
|
});
|
||||||
if (!subspace) {
|
if (!subspace) {
|
||||||
|
Reference in New Issue
Block a user