Skip to content

Commit

Permalink
Revert removal of the receipt param
Browse files Browse the repository at this point in the history
In `CategorizeTrackedExpense` and `ShareTrackedExpense` commands
  • Loading branch information
CyberAndrii committed Jan 11, 2025
1 parent 4491e85 commit d73353b
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/libs/API/parameters/CategorizeTrackedExpenseParams.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import type {Receipt} from '@src/types/onyx/Transaction';

type CategorizeTrackedExpenseParams = {
amount: number;
currency: string;
Expand All @@ -14,6 +16,7 @@ type CategorizeTrackedExpenseParams = {
reportPreviewReportActionID: string;
category?: string;
tag?: string;
receipt?: Receipt;
taxCode: string;
taxAmount: number;
billable?: boolean;
Expand Down
3 changes: 3 additions & 0 deletions src/libs/API/parameters/ShareTrackedExpenseParams.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import type {Receipt} from '@src/types/onyx/Transaction';

type ShareTrackedExpenseParams = {
amount: number;
currency: string;
Expand All @@ -14,6 +16,7 @@ type ShareTrackedExpenseParams = {
reportPreviewReportActionID: string;
category?: string;
tag?: string;
receipt?: Receipt;
taxCode: string;
taxAmount: number;
billable?: boolean;
Expand Down
5 changes: 5 additions & 0 deletions src/libs/actions/IOU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ type CategorizeTrackedExpenseTransactionParams = {
category?: string;
tag?: string;
billable?: boolean;
receipt?: Receipt;
};
type CategorizeTrackedExpensePolicyParams = {
policyID: string;
Expand Down Expand Up @@ -3851,6 +3852,7 @@ function shareTrackedExpense(
taxCode = '',
taxAmount = 0,
billable?: boolean,
receipt?: Receipt,
createdWorkspaceParams?: CreateWorkspaceParams,
) {
const {optimisticData, successData, failureData} = onyxData ?? {};
Expand Down Expand Up @@ -3893,6 +3895,7 @@ function shareTrackedExpense(
taxCode,
taxAmount,
billable,
receipt: receipt instanceof Blob ? receipt : undefined,
policyExpenseChatReportID: createdWorkspaceParams?.expenseChatReportID,
policyExpenseCreatedReportActionID: createdWorkspaceParams?.expenseCreatedReportActionID,
adminsChatReportID: createdWorkspaceParams?.adminsChatReportID,
Expand Down Expand Up @@ -4195,6 +4198,7 @@ function trackExpense(
category,
tag,
billable,
receipt: trackedReceipt instanceof Blob ? trackedReceipt : undefined,
};
const policyParams: CategorizeTrackedExpensePolicyParams = {
policyID: chatReport?.policyID ?? '-1',
Expand Down Expand Up @@ -4247,6 +4251,7 @@ function trackExpense(
taxCode,
taxAmount,
billable,
trackedReceipt,
createdWorkspaceParams,
);
break;
Expand Down

0 comments on commit d73353b

Please sign in to comment.