Skip to content

Commit

Permalink
add more types
Browse files Browse the repository at this point in the history
  • Loading branch information
luacmartins committed Oct 24, 2024
1 parent 89b9c6b commit a3302a8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/libs/SearchUIUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,12 +269,12 @@ function getAction(data: OnyxTypes.SearchResults['data'], key: string, currentUs
const allTransactions = isTransactionEntry(key) ? transaction : Object.keys(data).filter((item) => item.startsWith(ONYXKEYS.COLLECTION.TRANSACTION)) ?? {};

// TODO: update isSettled to take report object instead of connect to Onyx
if (ReportUtils.isSettled(report.reportID)) {
if (ReportUtils.isSettled(report?.reportID)) {
return CONST.SEARCH.ACTION_TYPES.PAID;
}

// TODO: create function to determine if report is done
if (ReportUtils.isSettled(report.reportID)) {
if (ReportUtils.isSettled(report?.reportID)) {
return CONST.SEARCH.ACTION_TYPES.DONE;
}

Expand Down
10 changes: 5 additions & 5 deletions src/libs/actions/IOU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ import type {ErrorFields, Errors} from '@src/types/onyx/OnyxCommon';
import type {PaymentMethodType} from '@src/types/onyx/OriginalMessage';
import type ReportAction from '@src/types/onyx/ReportAction';
import type {OnyxData} from '@src/types/onyx/Request';
import type {SearchTransaction} from '@src/types/onyx/SearchResults';
import type {SearchReport, SearchTransaction} from '@src/types/onyx/SearchResults';
import type {Comment, Receipt, ReceiptSource, Routes, SplitShares, TransactionChanges, WaypointCollection} from '@src/types/onyx/Transaction';
import {isEmptyObject} from '@src/types/utils/EmptyObject';
import * as CachedPDFPaths from './CachedPDFPaths';
Expand Down Expand Up @@ -7016,7 +7016,7 @@ function sendMoneyWithWallet(report: OnyxEntry<OnyxTypes.Report>, amount: number
Report.notifyNewAction(params.chatReportID, managerID);
}

function canApproveIOU(iouReport: OnyxTypes.OnyxInputOrEntry<OnyxTypes.Report>, policy: OnyxTypes.OnyxInputOrEntry<OnyxTypes.Policy>) {
function canApproveIOU(iouReport: OnyxTypes.OnyxInputOrEntry<OnyxTypes.Report> | SearchReport, policy: OnyxTypes.OnyxInputOrEntry<OnyxTypes.Policy>) {
// Only expense reports can be approved
const isPaidGroupPolicy = policy && PolicyUtils.isPaidGroupPolicy(policy);
if (!isPaidGroupPolicy) {
Expand All @@ -7041,8 +7041,8 @@ function canApproveIOU(iouReport: OnyxTypes.OnyxInputOrEntry<OnyxTypes.Report>,
}

function canIOUBePaid(
iouReport: OnyxTypes.OnyxInputOrEntry<OnyxTypes.Report>,
chatReport: OnyxTypes.OnyxInputOrEntry<OnyxTypes.Report>,
iouReport: OnyxTypes.OnyxInputOrEntry<OnyxTypes.Report> | SearchReport,
chatReport: OnyxTypes.OnyxInputOrEntry<OnyxTypes.Report> | SearchReport,
policy: OnyxTypes.OnyxInputOrEntry<OnyxTypes.Policy>,
transactions?: OnyxTypes.Transaction[],
onlyShowPayElsewhere = false,
Expand Down Expand Up @@ -7105,7 +7105,7 @@ function canIOUBePaid(
}

function canReportBeSubmitted(
moneyRequestReport: OnyxTypes.OnyxInputOrEntry<OnyxTypes.Report>,
moneyRequestReport: OnyxTypes.OnyxInputOrEntry<OnyxTypes.Report> | SearchReport,
policy: OnyxTypes.OnyxInputOrEntry<OnyxTypes.Policy>,
currentUserAccountID: number,
transaction?: OnyxTypes.Transaction,
Expand Down

0 comments on commit a3302a8

Please sign in to comment.