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