Added class validation for the enum

ref #6
This commit is contained in:
2020-12-18 19:49:39 +01:00
parent 595a9213c1
commit 2240a45a91
5 changed files with 13 additions and 3 deletions

View File

@@ -1,4 +1,5 @@
import {
IsEnum,
IsInt,
IsNotEmpty,
IsObject
@@ -29,12 +30,14 @@ export class ResponsePermission {
* The permissions's target.
*/
@IsNotEmpty()
@IsEnum(PermissionTarget)
target: PermissionTarget;
/**
* The permissions's action.
*/
@IsNotEmpty()
@IsEnum(PermissionAction)
action: PermissionAction;
public constructor(permission: Permission) {