Skip to content

Commit

Permalink
ERM-3126 Misleading tailing comma in OrganizationsArrayDisplay
Browse files Browse the repository at this point in the history
* render comma conditionally
* add index, key prop
  • Loading branch information
CalamityC committed Jan 17, 2024
1 parent cc08252 commit 1346af0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/OrganizationsArrayDisplay/OrganizationsArrayDisplay.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import React from 'react';
import { Row } from '@folio/stripes/components';

const OrganizationsArrayDisplay = ({ orgs }) => {
return orgs.map(record => {
const name = record.org?.name ? `${record.org.name}, ` : '';
return orgs.map((record, index) => {
const name = record.org?.name ? `${record.org.name}${index !== orgs.length - 1 ? ', ' : ''}` : '';
return (
<Row>
<Row key={index}>
{name}
</Row>
);
Expand Down

0 comments on commit 1346af0

Please sign in to comment.