Skip to content

Commit e8c00bd

Browse files
authored
Merge pull request #88473 from Expensify/claude-clearHoldReportActionPendingState
Clear pendingAction on hold/unhold report actions after success
2 parents 0a6ddcd + e0600c6 commit e8c00bd

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

src/libs/actions/IOU/Hold.ts

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,14 @@ function putOnHold(
144144
pendingAction: null,
145145
},
146146
},
147+
{
148+
onyxMethod: Onyx.METHOD.MERGE,
149+
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${reportID}`,
150+
value: {
151+
[createdReportAction.reportActionID]: {pendingAction: null},
152+
[createdReportActionComment.reportActionID]: {pendingAction: null},
153+
},
154+
},
147155
];
148156

149157
const failureData: Array<
@@ -420,7 +428,7 @@ function unholdRequest(transactionID: string, reportID: string, policy: OnyxEntr
420428
});
421429
}
422430

423-
const successData: Array<OnyxUpdate<typeof ONYXKEYS.COLLECTION.TRANSACTION | typeof ONYXKEYS.COLLECTION.REPORT>> = [
431+
const successData: Array<OnyxUpdate<typeof ONYXKEYS.COLLECTION.TRANSACTION | typeof ONYXKEYS.COLLECTION.REPORT | typeof ONYXKEYS.COLLECTION.REPORT_ACTIONS>> = [
424432
{
425433
onyxMethod: Onyx.METHOD.MERGE,
426434
key: `${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`,
@@ -431,6 +439,13 @@ function unholdRequest(transactionID: string, reportID: string, policy: OnyxEntr
431439
},
432440
},
433441
},
442+
{
443+
onyxMethod: Onyx.METHOD.MERGE,
444+
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${reportID}`,
445+
value: {
446+
[createdReportAction.reportActionID]: {pendingAction: null},
447+
},
448+
},
434449
];
435450

436451
const failureData: Array<

0 commit comments

Comments
 (0)