added devices and passwords of devices

This commit is contained in:
yousef-alkhrissat
2024-08-11 23:02:37 +03:00
parent da1117f432
commit 0b7a87b6bd
4 changed files with 136 additions and 1 deletions

View File

@ -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,
);
}
}
}