Skip to content

Commit 1daaabf

Browse files
authored
Merge pull request #46295 from koko57/fix/make-availableSpend-optional
2 parents 80531d6 + 21c8269 commit 1daaabf

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/pages/workspace/expensifyCard/WorkspaceEditCardLimitPage.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ function WorkspaceEditCardLimitPage({route}: WorkspaceEditCardLimitPageProps) {
7373

7474
const submit = (values: FormOnyxValues<typeof ONYXKEYS.FORMS.EDIT_EXPENSIFY_CARD_LIMIT_FORM>) => {
7575
const currentLimit = card.nameValuePairs?.limit ?? 0;
76-
const currentSpend = currentLimit - card.availableSpend;
76+
const currentSpend = currentLimit - (card.availableSpend ?? 0);
7777
const newLimit = Number(values[INPUT_IDS.LIMIT]) * 100;
7878
const newAvailableSpend = newLimit - currentSpend;
7979

src/types/onyx/Card.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ type Card = {
1414
bank: string;
1515

1616
/** Available amount to spend */
17-
availableSpend: number;
17+
availableSpend?: number;
1818

1919
/** Domain name */
2020
domainName: string;

0 commit comments

Comments
 (0)