Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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