Skip to content

Commit

Permalink
fix: changed name of kys array
Browse files Browse the repository at this point in the history
  • Loading branch information
barttom committed Jan 21, 2024
1 parent 17d1cec commit ea4e443
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,9 @@ const INPUT_KEYS = {
};

const STEP_FIELDS = [personalInfoStepKey.STREET, personalInfoStepKey.CITY, personalInfoStepKey.STATE, personalInfoStepKey.ZIP_CODE];
const REQUIRED_FIELDS = STEP_FIELDS;

const validate = (values: FormValues): OnyxCommon.Errors => {
const errors = ValidationUtils.getFieldRequiredErrors(values, REQUIRED_FIELDS);
const errors = ValidationUtils.getFieldRequiredErrors(values, STEP_FIELDS);

if (values.requestorAddressStreet && !ValidationUtils.isValidAddress(values.requestorAddressStreet)) {
errors.requestorAddressStreet = 'bankAccount.error.addressStreet';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,9 @@ type DateOfBirthProps = DateOfBirthOnyxProps & SubStepProps;

const personalInfoDobKey = CONST.BANK_ACCOUNT.PERSONAL_INFO_STEP.INPUT_KEY.DOB;
const STEP_FIELDS = [personalInfoDobKey];
const REQUIRED_FIELDS = STEP_FIELDS;

const validate = (values: FormValues): OnyxCommon.Errors => {
const errors = ValidationUtils.getFieldRequiredErrors(values, REQUIRED_FIELDS);
const errors = ValidationUtils.getFieldRequiredErrors(values, STEP_FIELDS);

if (values.dob) {
if (!ValidationUtils.isValidPastDate(values.dob) || !ValidationUtils.meetsMaximumAgeRequirement(values.dob)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@ type FullNameProps = FullNameOnyxProps & SubStepProps;

const personalInfoStepKey = CONST.BANK_ACCOUNT.PERSONAL_INFO_STEP.INPUT_KEY;
const STEP_FIELDS = [personalInfoStepKey.FIRST_NAME, personalInfoStepKey.LAST_NAME];
const REQUIRED_FIELDS = STEP_FIELDS;

const validate = (values: FormValues): OnyxCommon.Errors => ValidationUtils.getFieldRequiredErrors(values, REQUIRED_FIELDS);
const validate = (values: FormValues): OnyxCommon.Errors => ValidationUtils.getFieldRequiredErrors(values, STEP_FIELDS);

function FullName({reimbursementAccount, onNext, isEditing}: FullNameProps) {
const {translate} = useLocalize();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,9 @@ type SocialSecurityNumberProps = SocialSecurityNumberOnyxProps & SubStepProps;

const personalInfoStepKey = CONST.BANK_ACCOUNT.PERSONAL_INFO_STEP.INPUT_KEY;
const STEP_FIELDS = [personalInfoStepKey.SSN_LAST_4];
const REQUIRED_FIELDS = STEP_FIELDS;

const validate = (values: FormValues): OnyxCommon.Errors => {
const errors = ValidationUtils.getFieldRequiredErrors(values, REQUIRED_FIELDS);
const errors = ValidationUtils.getFieldRequiredErrors(values, STEP_FIELDS);

if (values.ssnLast4 && !ValidationUtils.isValidSSNLastFour(values.ssnLast4)) {
errors.ssnLast4 = 'bankAccount.error.ssnLast4';
Expand Down

0 comments on commit ea4e443

Please sign in to comment.