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
} from "class-validator";
@@ -25,12 +26,14 @@ export class CreatePermission {
* The permissions's target.
*/
@IsNotEmpty()
@IsEnum(PermissionTarget)
target: PermissionTarget;
/**
* The permissions's action.
*/
@IsNotEmpty()
@IsEnum(PermissionAction)
action: PermissionAction;
/**