From ba6a109885757482a24d4150e63e902c4237907c Mon Sep 17 00:00:00 2001 From: Youssef Lourayad Date: Fri, 16 Aug 2024 12:13:41 +0100 Subject: [PATCH 1/2] Fix reportID being passed to getPolicy instead of policyID --- src/libs/ReportUtils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index 822ac6bb699f..74a35c43b18c 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -3003,7 +3003,7 @@ function canEditFieldOfMoneyRequest(reportAction: OnyxInputOrEntry return false; } - const policy = getPolicy(moneyRequestReport?.reportID ?? '-1'); + const policy = getPolicy(moneyRequestReport?.policyID ?? ''); const isAdmin = isExpenseReport(moneyRequestReport) && policy?.role === CONST.POLICY.ROLE.ADMIN; const isManager = isExpenseReport(moneyRequestReport) && currentUserAccountID === moneyRequestReport?.managerID; From 0214b3fb311a64c5280576fd352327ac6f9fe5c9 Mon Sep 17 00:00:00 2001 From: Youssef Lourayad Date: Fri, 16 Aug 2024 12:17:24 +0100 Subject: [PATCH 2/2] Remove unnecessary operator --- src/libs/ReportUtils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index 74a35c43b18c..0769331f25db 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -3003,7 +3003,7 @@ function canEditFieldOfMoneyRequest(reportAction: OnyxInputOrEntry return false; } - const policy = getPolicy(moneyRequestReport?.policyID ?? ''); + const policy = getPolicy(moneyRequestReport?.policyID); const isAdmin = isExpenseReport(moneyRequestReport) && policy?.role === CONST.POLICY.ROLE.ADMIN; const isManager = isExpenseReport(moneyRequestReport) && currentUserAccountID === moneyRequestReport?.managerID;