diff --git a/src/libs/ReportActionsUtils.ts b/src/libs/ReportActionsUtils.ts index 486943494854..bc80eee4afc4 100644 --- a/src/libs/ReportActionsUtils.ts +++ b/src/libs/ReportActionsUtils.ts @@ -339,18 +339,6 @@ function isThreadParentMessage(reportAction: OnyxEntry, 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): OnyxEntry { - 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. */ @@ -1786,8 +1774,6 @@ export { getNumberOfMoneyRequests, getOneTransactionThreadReportID, getOriginalMessage, - // eslint-disable-next-line deprecation/deprecation - getParentReportAction, getRemovedFromApprovalChainMessage, getReportAction, getReportActionHtml, diff --git a/tests/actions/EnforceActionExportRestrictions.ts b/tests/actions/EnforceActionExportRestrictions.ts index 9590f878116e..76991ca24a98 100644 --- a/tests/actions/EnforceActionExportRestrictions.ts +++ b/tests/actions/EnforceActionExportRestrictions.ts @@ -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', () => {