Skip to content

Commit

Permalink
Merge pull request #23916 from Expensify/vit-fix23824
Browse files Browse the repository at this point in the history
[CP Staging] Disallow deleting split actions

(cherry picked from commit f0de085)
  • Loading branch information
Beamanator authored and OSBotify committed Jul 31, 2023
1 parent bd904cf commit 41de21c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/libs/ReportUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,10 @@ function isCurrentUserSubmitter(reportID) {
* @returns {Boolean}
*/
function canDeleteReportAction(reportAction, reportID) {
// For now, users cannot delete split actions
if (ReportActionsUtils.isMoneyRequestAction(reportAction) && lodashGet(reportAction, 'originalMessage.type') === CONST.IOU.REPORT_ACTION_TYPE.SPLIT) {
return false;
}
const isActionOwner = reportAction.actorAccountID === currentUserAccountID;
if (isActionOwner && ReportActionsUtils.isMoneyRequestAction(reportAction) && !isSettled(reportAction.originalMessage.IOUReportID)) {
return true;
Expand Down

0 comments on commit 41de21c

Please sign in to comment.