mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-07-16 02:36:19 +00:00
Update user-device-permission error message
This commit is contained in:
@ -26,8 +26,8 @@ export class UserDevicePermissionController {
|
||||
private readonly userDevicePermissionService: UserDevicePermissionService,
|
||||
) {}
|
||||
|
||||
// @ApiBearerAuth()
|
||||
// @UseGuards(JwtAuthGuard)
|
||||
@ApiBearerAuth()
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Post('add')
|
||||
async addDevicePermission(
|
||||
@Body() userDevicePermissionDto: UserDevicePermissionAddDto,
|
||||
|
@ -26,7 +26,7 @@ export class UserDevicePermissionService {
|
||||
} catch (error) {
|
||||
if (error.code === '23505') {
|
||||
throw new HttpException(
|
||||
'This Permission already belongs to this user',
|
||||
'This User already belongs to this device',
|
||||
HttpStatus.BAD_REQUEST,
|
||||
);
|
||||
}
|
||||
@ -56,7 +56,7 @@ export class UserDevicePermissionService {
|
||||
} catch (error) {
|
||||
if (error.code === '23505') {
|
||||
throw new HttpException(
|
||||
'This Permission already belongs to this user',
|
||||
'This User already belongs to this device',
|
||||
HttpStatus.BAD_REQUEST,
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user