Skip to content

Commit 5bcb4bc

Browse files
committed
unarchive expense report when moving to a different workspace
1 parent ac8e0f3 commit 5bcb4bc

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

src/libs/actions/Report.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5635,6 +5635,22 @@ function buildOptimisticChangePolicyData(report: Report, policyID: string, repor
56355635
},
56365636
});
56375637

5638+
// 5. Make sure the expense report is unarchived
5639+
optimisticData.push({
5640+
onyxMethod: Onyx.METHOD.MERGE,
5641+
key: `${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${reportID}`,
5642+
value: {
5643+
private_isArchived: null,
5644+
},
5645+
});
5646+
failureData.push({
5647+
onyxMethod: Onyx.METHOD.MERGE,
5648+
key: `${ONYXKEYS.COLLECTION.REPORT_NAME_VALUE_PAIRS}${reportID}`,
5649+
value: {
5650+
private_isArchived: DateUtils.getDBTime(),
5651+
},
5652+
});
5653+
56385654
return {optimisticData, successData, failureData, optimisticReportPreviewAction, optimisticMovedReportAction};
56395655
}
56405656

0 commit comments

Comments
 (0)