mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-11-27 12:34:53 +00:00
removed unit,floor,building,room modules
This commit is contained in:
@ -1,4 +1,3 @@
|
||||
import { SpaceType } from '@app/common/constants/space-type.enum';
|
||||
import { SpaceRepository } from '@app/common/modules/space/repositories';
|
||||
import {
|
||||
Injectable,
|
||||
@ -37,14 +36,9 @@ export class CheckUnitTypeGuard implements CanActivate {
|
||||
async checkFloorIsFloorType(unitUuid: string) {
|
||||
const unitData = await this.spaceRepository.findOne({
|
||||
where: { uuid: unitUuid },
|
||||
relations: ['spaceType'],
|
||||
});
|
||||
|
||||
if (
|
||||
!unitData ||
|
||||
!unitData.spaceType ||
|
||||
unitData.spaceType.type !== SpaceType.UNIT
|
||||
) {
|
||||
if (!unitData) {
|
||||
throw new BadRequestException('Invalid unit UUID');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user