mirror of
https://github.com/SyncrowIOT/backend.git
synced 2026-10-23 13:27:54 +00:00
finished refactor devices module
This commit is contained in:
@@ -15,14 +15,17 @@ export class CheckFourAndSixSceneDeviceTypeGuard implements CanActivate {
|
||||
async canActivate(context: ExecutionContext): Promise<boolean> {
|
||||
const request = context.switchToHttp().getRequest();
|
||||
const deviceUuid = request.params.deviceUuid;
|
||||
|
||||
const projectUuid = request.user.project.uuid;
|
||||
if (!deviceUuid) {
|
||||
throw new BadRequestException('Device UUID is required');
|
||||
}
|
||||
|
||||
try {
|
||||
const deviceDetails =
|
||||
await this.deviceService.getDeviceByDeviceUuid(deviceUuid);
|
||||
const deviceDetails = await this.deviceService.getDeviceByDeviceUuid(
|
||||
deviceUuid,
|
||||
true,
|
||||
projectUuid,
|
||||
);
|
||||
|
||||
if (
|
||||
deviceDetails.productDevice.prodType !== ProductType.FOUR_S &&
|
||||
|
||||
Reference in New Issue
Block a user