Skip to content

Commit

Permalink
Merge pull request #27520 from kubabutkiewicz/ts-migration/ReportActi…
Browse files Browse the repository at this point in the history
…ons-lib

[No QA] [TS migration] Migrate 'ReportActions.js' lib to TypeScript
  • Loading branch information
Joel Bettner authored Sep 25, 2023
2 parents d0d16fb + b11a60e commit 84247de
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ import ONYXKEYS from '../../ONYXKEYS';
import CONST from '../../CONST';
import * as ReportActionUtils from '../ReportActionsUtils';
import * as ReportUtils from '../ReportUtils';
import ReportAction from '../../types/onyx/ReportAction';

/**
* @param {String} reportID
* @param {Object} reportAction
*/
function clearReportActionErrors(reportID, reportAction) {
function clearReportActionErrors(reportID: string, reportAction: ReportAction) {
const originalReportID = ReportUtils.getOriginalReportID(reportID, reportAction);

if (!reportAction.reportActionID) {
return;
}

if (reportAction.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.ADD) {
// Delete the optimistic action
Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${originalReportID}`, {
Expand Down

0 comments on commit 84247de

Please sign in to comment.