update pos consumer
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
import { ValidatorFn } from '@angular/forms';
|
||||
|
||||
export function nationalIdValidator(): ValidatorFn {
|
||||
return (control) => {
|
||||
if (control.value === null || control.value === undefined || control.value === '') {
|
||||
return null;
|
||||
}
|
||||
return control.value.length === 10 && /^[0-9]{10}$/.test(control.value)
|
||||
? null
|
||||
: { nationalId: true };
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user