Skip to content

Commit

Permalink
refactor: use correct types
Browse files Browse the repository at this point in the history
  • Loading branch information
hurali97 committed Mar 27, 2024
1 parent c4b6d85 commit 11917c4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/libs/OptionsListUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -752,13 +752,13 @@ function getReportOption(participant: Participant): ReportUtils.OptionData {
/**
* Get the option for a policy expense report.
*/
function getPolicyExpenseReportOption(report: Report): ReportUtils.OptionData {
const expenseReport = ReportUtils.isPolicyExpenseChat(report) ? report : null;
function getPolicyExpenseReportOption(participant: Participant | ReportUtils.OptionData): ReportUtils.OptionData {
const expenseReport = ReportUtils.isPolicyExpenseChat(participant) ? ReportUtils.getReport(participant.reportID) : null;

const option = createOption(
expenseReport?.visibleChatMemberAccountIDs ?? [],
allPersonalDetails ?? {},
expenseReport,
!isEmptyObject(expenseReport) ? expenseReport : null,
{},
{
showChatPreviewLine: false,
Expand All @@ -769,8 +769,8 @@ function getPolicyExpenseReportOption(report: Report): ReportUtils.OptionData {
// Update text & alternateText because createOption returns workspace name only if report is owned by the user
option.text = ReportUtils.getPolicyName(expenseReport);
option.alternateText = Localize.translateLocal('workspace.common.workspace');
option.selected = report.selected;
option.isSelected = report.selected;
option.selected = expenseReport?.selected;
option.isSelected = expenseReport?.selected;
return option;
}

Expand Down

0 comments on commit 11917c4

Please sign in to comment.