Skip to content

Commit

Permalink
Added 'created' parameter to SplitBillParams type
Browse files Browse the repository at this point in the history
  • Loading branch information
brunovjk committed Feb 8, 2024
1 parent d00fca8 commit 3fc8ac6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/libs/API/parameters/SplitBillParams.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ type SplitBillParams = {
amount: number;
splits: string;
comment: string;
created: string;
currency: string;
merchant: string;
category: string;
Expand Down
18 changes: 12 additions & 6 deletions src/libs/actions/IOU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1377,6 +1377,7 @@ function createSplitsAndOnyxData(
currentUserAccountID: number,
amount: number,
comment: string,
created: string,
currency: string,
merchant: string,
category: string,
Expand All @@ -1398,7 +1399,7 @@ function createSplitsAndOnyxData(
currency,
CONST.REPORT.SPLIT_REPORTID,
comment,
'',
created,
'',
'',
merchant || Localize.translateLocal('iou.request'),
Expand Down Expand Up @@ -1610,7 +1611,7 @@ function createSplitsAndOnyxData(
currency,
oneOnOneIOUReport.reportID,
comment,
'',
created,
CONST.IOU.TYPE.SPLIT,
splitTransaction.transactionID,
merchant || Localize.translateLocal('iou.request'),
Expand Down Expand Up @@ -1738,6 +1739,7 @@ function splitBill(
currentUserAccountID: number,
amount: number,
comment: string,
created: string,
currency: string,
merchant: string,
category: string,
Expand All @@ -1751,6 +1753,7 @@ function splitBill(
currentUserAccountID,
amount,
comment,
created,
currency,
merchant,
category,
Expand All @@ -1763,10 +1766,11 @@ function splitBill(
reportID: splitData.chatReportID,
amount,
splits: JSON.stringify(splits),
currency,
comment,
category,
created,
currency,
merchant,
category,
tag,
billable,
transactionID: splitData.transactionID,
Expand All @@ -1791,21 +1795,23 @@ function splitBillAndOpenReport(
currentUserAccountID: number,
amount: number,
comment: string,
created: string,
currency: string,
merchant: string,
category: string,
tag: string,
billable: boolean,
) {
const {splitData, splits, onyxData} = createSplitsAndOnyxData(participants, currentUserLogin, currentUserAccountID, amount, comment, currency, merchant, category, tag);
const {splitData, splits, onyxData} = createSplitsAndOnyxData(participants, currentUserLogin, currentUserAccountID, amount, comment, created, currency, merchant, category, tag);

const parameters: SplitBillParams = {
reportID: splitData.chatReportID,
amount,
splits: JSON.stringify(splits),
comment,
created,
currency,
merchant,
comment,
category,
tag,
billable,
Expand Down
3 changes: 3 additions & 0 deletions src/pages/iou/request/step/IOURequestStepConfirmation.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ function IOURequestStepConfirmation({
const createTransaction = useCallback(
(selectedParticipants) => {
const trimmedComment = lodashGet(transaction, 'comment.comment', '').trim();
const transactionCreated = TransactionUtils.getCreated(transaction);

// Don't let the form be submitted multiple times while the navigator is waiting to take the user to a different page
if (formHasBeenSubmitted.current) {
Expand Down Expand Up @@ -273,6 +274,7 @@ function IOURequestStepConfirmation({
currentUserPersonalDetails.accountID,
transaction.amount,
trimmedComment,
transactionCreated,
transaction.currency,
transaction.merchant,
transaction.category,
Expand All @@ -291,6 +293,7 @@ function IOURequestStepConfirmation({
currentUserPersonalDetails.accountID,
transaction.amount,
trimmedComment,
transactionCreated,
transaction.currency,
transaction.merchant,
transaction.category,
Expand Down

0 comments on commit 3fc8ac6

Please sign in to comment.