Skip to content

Commit

Permalink
Minor
Browse files Browse the repository at this point in the history
  • Loading branch information
bistaastha committed Jan 9, 2025
1 parent ec3c836 commit 58ea384
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ export class SpenderOnboardingConnectCardStepComponent implements OnInit, OnChan
);
} else {
this.singleEnrollableCardDetails.card_type = this.realTimeFeedService.getCardTypeFromNumber(
this.fg.controls.card_number.value as string
this.fg.controls.card_number?.value as string
);
}
}
Expand All @@ -270,7 +270,7 @@ export class SpenderOnboardingConnectCardStepComponent implements OnInit, OnChan
return (): ValidationErrors | null => {
// Reactive forms are not strongly typed in Angular 13, so we need to cast the value to string
// TODO (Angular 14 >): Remove the type casting and directly use string type for the form control
const cardNumber = cardId ? this.getFullCardNumber(cardId) : (this.fg.controls.card_number.value as string);
const cardNumber = cardId ? this.getFullCardNumber(cardId) : (this.fg.controls.card_number?.value as string);

const isValid = this.realTimeFeedService.isCardNumberValid(cardNumber);
const cardType = this.realTimeFeedService.getCardTypeFromNumber(cardNumber);
Expand All @@ -285,7 +285,7 @@ export class SpenderOnboardingConnectCardStepComponent implements OnInit, OnChan

private cardNetworkValidator(cardId?: string): ValidatorFn {
return (): ValidationErrors | null => {
const cardNumber = cardId ? this.getFullCardNumber(cardId) : (this.fg.controls.card_number.value as string);
const cardNumber = cardId ? this.getFullCardNumber(cardId) : (this.fg.controls.card_number?.value as string);
const cardType = this.realTimeFeedService.getCardTypeFromNumber(cardNumber);

if (
Expand Down

0 comments on commit 58ea384

Please sign in to comment.