Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Align default IDs in IOU.ts file #54534

Draft
wants to merge 30 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift click to select a range
2cd62ce
chore: test commit for the linter
adhorodyski Dec 18, 2024
2f53a1a
chore: fix lint errors on missing CONST.DEFAULT_NUMBER_ID usages for …
adhorodyski Dec 18, 2024
9f0352f
chore: rm a dummy console log
adhorodyski Dec 18, 2024
dd0de46
chore: remove an eslint override for the IOU.ts file exclusion
adhorodyski Dec 18, 2024
661790f
chore: add an early return for transactionThreadReportIDs of undefined
adhorodyski Dec 18, 2024
1ddfa90
chore: add an early return on invalid input to the payInvoice function
adhorodyski Dec 18, 2024
529b1f6
chore: filter out undefiend values
adhorodyski Dec 19, 2024
17829b7
chore: allow undefined output from getIOURequestPolicyID
adhorodyski Dec 19, 2024
cf617bd
chore: remove a fallback index access on the failure data
adhorodyski Dec 19, 2024
1b42796
chore: early return on missing input to the cancelPayment func
adhorodyski Dec 19, 2024
2042569
chore: remove more onyx key fallbacks
adhorodyski Dec 19, 2024
c98da87
Merge branch 'Expensify:main' into chore/eslint-consistent-id-iou
adhorodyski Dec 19, 2024
d268002
chore: optionally push to the optimistic data
adhorodyski Dec 19, 2024
93d2cbd
chore: wrap a success data push in an if statement for undefined input
adhorodyski Dec 19, 2024
2c83daa
chore: wrap a failure data push in an if statement for undefined input
adhorodyski Dec 19, 2024
135baa7
chore: wrap L1831 failure data push
adhorodyski Dec 19, 2024
0ab1de1
chore: early return on missing splitData.createdReportActionID for th…
adhorodyski Dec 19, 2024
46e8c8e
chore: pass in undefined with a missing childReportID
adhorodyski Dec 19, 2024
390df26
chore: extract an optimisticData push to ensure a param
adhorodyski Dec 19, 2024
cdccb13
chore: use string or undefined as a value
adhorodyski Dec 19, 2024
de2c69b
chore: call 2 new optimistic updates only on conditions met
adhorodyski Dec 19, 2024
2ece26c
Merge branch 'refs/heads/main' into chore/eslint-consistent-id-iou
VickyStash Dec 20, 2024
2332beb
Update getLastVisibleAction and getLastVisibleMessage functions. Remo…
VickyStash Dec 20, 2024
871a257
Remove '-1' id from object keys
VickyStash Dec 20, 2024
80901b5
Fix test
VickyStash Dec 20, 2024
617f8b0
Merge branch 'refs/heads/main' into chore/eslint-consistent-id-iou
VickyStash Dec 24, 2024
0caab12
Fix params related lint errors
VickyStash Dec 24, 2024
ac221d1
Merge branch 'refs/heads/main' into chore/eslint-consistent-id-iou
VickyStash Dec 30, 2024
bf73430
Lint fix
VickyStash Dec 30, 2024
a0905d6
Code polish
VickyStash Dec 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: add an early return on invalid input to the payInvoice function
  • Loading branch information
adhorodyski committed Dec 19, 2024
commit 1ddfa9093607423689efdd3386f0fe0010d80fa9
6 changes: 5 additions & 1 deletion src/libs/actions/IOU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7901,8 7901,12 @@ function payInvoice(paymentMethodType: PaymentMethodType, chatReport: OnyxTypes.
const paymentSelected = paymentMethodType === CONST.IOU.PAYMENT_TYPE.VBBA ? CONST.IOU.PAYMENT_SELECTED.BBA : CONST.IOU.PAYMENT_SELECTED.PBA;
completePaymentOnboarding(paymentSelected);

if (!invoiceReport?.reportID) {
return;
}

let params: PayInvoiceParams = {
reportID: invoiceReport?.reportID ?? '',
reportID: invoiceReport.reportID,
reportActionID,
paymentMethodType,
payAsBusiness,
Expand Down