Skip to content

Fix #111: Match scouting errors for secondary robots#171

Open
JL102 wants to merge 1 commit intomasterfrom
secondary-teams
Open

Fix #111: Match scouting errors for secondary robots#171
JL102 wants to merge 1 commit intomasterfrom
secondary-teams

Conversation

@JL102
Copy link
Collaborator

@JL102 JL102 commented Nov 13, 2023

No description provided.

@JL102 JL102 linked an issue Nov 13, 2023 that may be closed by this pull request
@JL102 JL102 requested a review from caburum November 13, 2023 18:55
Comment on lines +84 to +91
let letterTeamMatch = /(frc\d+)[a-zA-Z]$/g.exec(teamKey);
// if so, just find the info for the team without the letter on the end (found w/ a capturing group1)
if (letterTeamMatch) {
team = await utilities.findOne('teams', {key: letterTeamMatch[1]}, {}, {allowCache: true});
}
else {
team = await utilities.findOne('teams', {key: teamKey}, {}, {allowCache: true});
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like it should work, but I think this could potentially cause other errors to happen in stats pages- maybe we should abstract this code to a general getTeam function that can compensate for letter team keys.

@caburum
Copy link
Contributor

caburum commented Jan 23, 2024

have we tested if this works? if so, lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Match scouting errors for secondary robots

2 participants