@@ -9,6 +9,7 @@ import {ProgressSpinnerModule} from 'primeng/progressspinner';
9
9
import { CardModule } from 'primeng/card' ;
10
10
import { ConfirmDialogModule } from 'primeng/confirmdialog' ;
11
11
import { ToastModule } from 'primeng/toast' ;
12
+ import { ConfirmationService } from 'primeng/api' ;
12
13
import { EnumValue , SalaryType , SalaryTypeEnum , convertEnumToArray } from '@core/enums' ;
13
14
import { CreateEmployee , Role , User } from '@core/models' ;
14
15
import { ApiService , ToastService } from '@core/services' ;
@@ -38,6 +39,7 @@ import {ValidationSummaryComponent} from '@shared/components';
38
39
] ,
39
40
providers : [
40
41
UserService ,
42
+ ConfirmationService
41
43
] ,
42
44
} )
43
45
export class AddEmployeeComponent implements OnInit {
@@ -59,7 +61,7 @@ export class AddEmployeeComponent implements OnInit {
59
61
60
62
this . form = new FormGroup < CreateEmployeeForm > ( {
61
63
user : new FormControl ( null , { validators : Validators . required } ) ,
62
- role : new FormControl ( null , { validators : Validators . required } ) ,
64
+ role : new FormControl ( null ) ,
63
65
salary : new FormControl < number > ( 0 , { validators : Validators . required , nonNullable : true } ) ,
64
66
salaryType : new FormControl < SalaryType > ( SalaryType . None , { validators : Validators . required , nonNullable : true } )
65
67
} ) ;
@@ -79,7 +81,7 @@ export class AddEmployeeComponent implements OnInit {
79
81
80
82
clearSelctedRole ( ) {
81
83
this . form . patchValue ( {
82
- role : { name : '' , displayName : ' ' } ,
84
+ role : null ,
83
85
} ) ;
84
86
}
85
87
0 commit comments