Skip to content

Commit

Permalink
Merge pull request #21161 from Expensify/cmartins-fixOldSplitBillDetails
Browse files Browse the repository at this point in the history
Use participant accountIDs in SplitBill details page
  • Loading branch information
cristipaval authored Jun 20, 2023
2 parents 62e6453 + 4472533 commit 5256935
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/pages/iou/SplitBillDetailsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 5256935

Please sign in to comment.