mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-11-26 08:54:54 +00:00
added devices and passwords of devices
This commit is contained in:
@ -6,6 +6,7 @@ import {
|
||||
HttpException,
|
||||
HttpStatus,
|
||||
UseGuards,
|
||||
Get,
|
||||
} from '@nestjs/common';
|
||||
import { ApiTags, ApiBearerAuth } from '@nestjs/swagger';
|
||||
import {
|
||||
@ -122,4 +123,26 @@ export class VisitorPasswordController {
|
||||
);
|
||||
}
|
||||
}
|
||||
@Get('')
|
||||
async GetVisitorPassword() {
|
||||
try {
|
||||
return await this.visitorPasswordService.getPasswords();
|
||||
} catch (error) {
|
||||
throw new HttpException(
|
||||
error.message || 'Internal server error',
|
||||
error.status || HttpStatus.INTERNAL_SERVER_ERROR,
|
||||
);
|
||||
}
|
||||
}
|
||||
@Get('/devices')
|
||||
async GetVisitorDevices() {
|
||||
try {
|
||||
return await this.visitorPasswordService.getAllPassDevices();
|
||||
} catch (error) {
|
||||
throw new HttpException(
|
||||
error.message || 'Internal server error',
|
||||
error.status || HttpStatus.INTERNAL_SERVER_ERROR,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user