From 44725336fc3172750741cb3da40549bae09f4096 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Tue, 20 Jun 2023 14:34:08 -0600 Subject: [PATCH] get participant account ids --- src/pages/iou/SplitBillDetailsPage.js | 6 ++++-- .../MoneyRequestParticipantsSplitSelector.js | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/pages/iou/SplitBillDetailsPage.js b/src/pages/iou/SplitBillDetailsPage.js index d3f1847b373a..f6b63be4df76 100644 --- a/src/pages/iou/SplitBillDetailsPage.js +++ b/src/pages/iou/SplitBillDetailsPage.js @@ -18,6 +18,7 @@ import withReportOrNotFound from '../home/report/withReportOrNotFound'; import FullPageNotFoundView from '../../components/BlockingViews/FullPageNotFoundView'; import CONST from '../../CONST'; import HeaderWithBackButton from '../../components/HeaderWithBackButton'; +import * as PersonalDetailsUtils from '../../libs/PersonalDetailsUtils'; const propTypes = { /* Onyx Props */ @@ -64,8 +65,9 @@ function getReportID(route) { function SplitBillDetailsPage(props) { const reportAction = props.reportActions[`${props.route.params.reportActionID.toString()}`]; - const personalDetails = OptionsListUtils.getPersonalDetailsForAccountIDs(reportAction.originalMessage.participantAccountIDs, props.personalDetails); - const participants = OptionsListUtils.getParticipantsOptions(reportAction.originalMessage, personalDetails); + const participantAccountIDs = reportAction.originalMessage.participantAccountIDs || PersonalDetailsUtils.getAccountIDsByLogins(reportAction.originalMessage.participants); + const personalDetails = OptionsListUtils.getPersonalDetailsForAccountIDs(participantAccountIDs, props.personalDetails); + const participants = OptionsListUtils.getParticipantsOptions({participantAccountIDs}, personalDetails); const payeePersonalDetails = personalDetails[reportAction.actorAccountID]; const participantsExcludingPayee = _.filter(participants, (participant) => participant.accountID !== reportAction.actorAccountID); const splitAmount = parseInt(lodashGet(reportAction, 'originalMessage.amount', 0), 10); diff --git a/src/pages/iou/steps/MoneyRequstParticipantsPage/MoneyRequestParticipantsSplitSelector.js b/src/pages/iou/steps/MoneyRequstParticipantsPage/MoneyRequestParticipantsSplitSelector.js index 638cb1250f64..8d03f0189f9c 100755 --- a/src/pages/iou/steps/MoneyRequstParticipantsPage/MoneyRequestParticipantsSplitSelector.js +++ b/src/pages/iou/steps/MoneyRequstParticipantsPage/MoneyRequestParticipantsSplitSelector.js @@ -28,7 +28,7 @@ const propTypes = { /** Selected participants from MoneyRequestModal with login */ participants: PropTypes.arrayOf( PropTypes.shape({ - login: PropTypes.string.isRequired, + login: PropTypes.string, accountID: PropTypes.number.isRequired, alternateText: PropTypes.string, hasDraftComment: PropTypes.bool,