File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -661,7 +661,7 @@ export default function PlayerManagement() {
661661 />
662662 < input
663663 type = "text"
664- placeholder = "Last Name"
664+ placeholder = "Last Name (If middle name or multi-word last name, include here) "
665665 value = { newPlayer . lastName }
666666 onChange = { ( e ) =>
667667 setNewPlayer ( { ...newPlayer , lastName : e . target . value } )
Original file line number Diff line number Diff line change @@ -41,12 +41,15 @@ async function getPlayerData(playerId) {
4141 return null
4242 }
4343
44+ console . log ( playerId )
4445 // Find player by matching the cleaned versions of first and last names
45- const [ firstName , lastName ] = playerId . split ( '-' )
46+ // Assume Multi-word names include middle/multiword last names in last name
47+ const [ firstName , ...lastNameParts ] = playerId . split ( '-' )
48+ const lastName = lastNameParts . join ( '-' )
4649 const targetPlayer = mensTeam . players . find (
4750 ( player ) =>
48- cleanString ( player . firstName ) === firstName &&
49- cleanString ( player . lastName ) === lastName
51+ cleanString ( player . firstName ) === cleanString ( firstName ) &&
52+ cleanString ( player . lastName ) === cleanString ( lastName )
5053 )
5154
5255 if ( ! targetPlayer ) {
You can’t perform that action at this time.
0 commit comments