Skip to content

Commit

Permalink
Merge pull request #50211 from nkdengineer/fix/49551
Browse files Browse the repository at this point in the history
fix: Remove deprecated ReportActionUtils.getParentReportAction method
  • Loading branch information
bondydaa authored Oct 14, 2024
2 parents 2ea1973 + 3c1a533 commit a7b28a4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
14 changes: 0 additions & 14 deletions src/libs/ReportActionsUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -344,18 +344,6 @@ function isThreadParentMessage(reportAction: OnyxEntry<ReportAction>, reportID:
return childType === CONST.REPORT.TYPE.CHAT && (childVisibleActionCount > 0 || String(childReportID) === reportID);
}

/**
* Returns the parentReportAction if the given report is a thread/task.
*
* @deprecated Use Onyx.connect() or withOnyx() instead
*/
function getParentReportAction(report: OnyxInputOrEntry<Report>): OnyxEntry<ReportAction> {
if (!report?.parentReportID || !report.parentReportActionID) {
return undefined;
}
return allReportActions?.[`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${report.parentReportID}`]?.[report.parentReportActionID];
}

/**
* Determines if the given report action is sent money report action by checking for 'pay' type and presence of IOUDetails object.
*/
Expand Down Expand Up @@ -1807,8 +1795,6 @@ export {
getNumberOfMoneyRequests,
getOneTransactionThreadReportID,
getOriginalMessage,
// eslint-disable-next-line deprecation/deprecation
getParentReportAction,
getRemovedFromApprovalChainMessage,
getReportAction,
getReportActionHtml,
Expand Down
5 changes: 5 additions & 0 deletions tests/actions/EnforceActionExportRestrictions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,11 @@ describe('Task', () => {
// @ts-expect-error the test is asserting that it's undefined, so the TS error is normal
expect(Task.getParentReport).toBeUndefined();
});

it('does not export getParentReportAction', () => {
// @ts-expect-error the test is asserting that it's undefined, so the TS error is normal
expect(Task.getParentReportAction).toBeUndefined();
});
});

describe('OptionsListUtils', () => {
Expand Down

0 comments on commit a7b28a4

Please sign in to comment.