Fixed issue with utforandeverksamheter in employees
This commit is contained in:
@@ -22,7 +22,6 @@ export interface Employee {
|
||||
tjanstCodes: string[];
|
||||
tjanster?: Tjanst[];
|
||||
allaUtforandeVerksamheter: boolean;
|
||||
utforandeVerksamhet: string[];
|
||||
utforandeVerksamhetIds: number[];
|
||||
utforandeAdressIds: number[];
|
||||
}
|
||||
@@ -37,21 +36,12 @@ export interface EmployeeRequestData {
|
||||
roles: string[];
|
||||
tjansteKoder: string[];
|
||||
allaUtforandeVerksamheter: boolean;
|
||||
utforandeVerksamhet: string[];
|
||||
utforandeVerksamhetIds: number[];
|
||||
adressIds: number[];
|
||||
}
|
||||
|
||||
export function mapEmployeeToRequestData(data: Employee): EmployeeRequestData {
|
||||
const {
|
||||
email,
|
||||
roles,
|
||||
tjanstCodes,
|
||||
allaUtforandeVerksamheter,
|
||||
utforandeVerksamhet,
|
||||
utforandeVerksamhetIds,
|
||||
utforandeAdressIds,
|
||||
} = data;
|
||||
const { email, roles, tjanstCodes, allaUtforandeVerksamheter, utforandeVerksamhetIds, utforandeAdressIds } = data;
|
||||
|
||||
return {
|
||||
email,
|
||||
@@ -60,7 +50,6 @@ export function mapEmployeeToRequestData(data: Employee): EmployeeRequestData {
|
||||
utforandeVerksamhetIds,
|
||||
adressIds: utforandeAdressIds,
|
||||
allaUtforandeVerksamheter: allaUtforandeVerksamheter,
|
||||
utforandeVerksamhet: utforandeVerksamhet,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -85,7 +74,6 @@ export function mapResponseToEmployee(data: EmployeeResponse): Employee {
|
||||
roles,
|
||||
tjansteKoder,
|
||||
allaUtforandeVerksamheter,
|
||||
utforandeVerksamhet,
|
||||
utforandeVerksamhetIds,
|
||||
adressIds,
|
||||
} = data;
|
||||
@@ -99,7 +87,6 @@ export function mapResponseToEmployee(data: EmployeeResponse): Employee {
|
||||
roles: roles || [],
|
||||
tjanstCodes: tjansteKoder || [],
|
||||
allaUtforandeVerksamheter,
|
||||
utforandeVerksamhet: utforandeVerksamhet || [],
|
||||
utforandeVerksamhetIds: utforandeVerksamhetIds || [],
|
||||
utforandeAdressIds: adressIds || [],
|
||||
};
|
||||
|
||||
@@ -16,7 +16,7 @@ export function EmailValidator(label = 'Fältet'): ValidatorFn {
|
||||
export function CommaSeparatedEmailValidator(): ValidatorFn {
|
||||
return (control: AbstractControl): ValidationError => {
|
||||
if (control && control.value) {
|
||||
const values: string[] = (control.value as string).replaceAll(' ', '').split(',');
|
||||
const values: string[] = (control.value as string).trim().split(',');
|
||||
const invalidEmailaddresses = [];
|
||||
|
||||
values.forEach(value => {
|
||||
|
||||
Reference in New Issue
Block a user