From 021d78410cffe51bb367e0fa78243547e8105c2c Mon Sep 17 00:00:00 2001 From: daledah Date: Mon, 2 Dec 2024 18:48:10 +0700 Subject: [PATCH] fix: get manager ID from approval chain --- src/libs/actions/IOU.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/actions/IOU.ts b/src/libs/actions/IOU.ts index 6710823df16a..97bd96c61212 100644 --- a/src/libs/actions/IOU.ts +++ b/src/libs/actions/IOU.ts @@ -7191,7 +7191,7 @@ function submitReport(expenseReport: OnyxTypes.Report) { const optimisticSubmittedReportAction = ReportUtils.buildOptimisticSubmittedReportAction(expenseReport?.total ?? 0, expenseReport.currency ?? '', expenseReport.reportID, adminAccountID); const optimisticNextStep = NextStepUtils.buildNextStep(expenseReport, isSubmitAndClosePolicy ? CONST.REPORT.STATUS_NUM.CLOSED : CONST.REPORT.STATUS_NUM.SUBMITTED); const approvalChain = ReportUtils.getApprovalChain(PolicyUtils.getPolicy(expenseReport?.policyID), expenseReport); - const managerID = approvalChain.length ? Number(approvalChain.at(0)) : undefined; + const managerID = PersonalDetailsUtils.getAccountIDsByLogins(approvalChain).at(0); const optimisticData: OnyxUpdate[] = !isSubmitAndClosePolicy ? [