diff --git a/package-lock.json b/package-lock.json index 57038354..7b300c98 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8225,9 +8225,9 @@ } }, "node_modules/http-cache-semantics": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz", - "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", + "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==", "dev": true }, "node_modules/http-errors": { @@ -24106,9 +24106,9 @@ } }, "http-cache-semantics": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz", - "integrity": "sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", + "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==", "dev": true }, "http-errors": { diff --git a/src/client/components/admin/teams/AdminTeamSquadsPage.js b/src/client/components/admin/teams/AdminTeamSquadsPage.js index 2b126ea7..39a9f3a0 100644 --- a/src/client/components/admin/teams/AdminTeamSquadsPage.js +++ b/src/client/components/admin/teams/AdminTeamSquadsPage.js @@ -50,7 +50,7 @@ class AdminTeamSquadsPage extends Component { } renderSquadSelector() { - const { squad, team } = this.state; + const { team } = this.state; const { match, history, teamTypes } = this.props; const { squadId } = match.params; @@ -59,10 +59,8 @@ class AdminTeamSquadsPage extends Component { //Get Default let value; - if (squadId === "new") { - value = newOption; - } else if (squad) { - value = { label: `${squad.year} ${teamTypes[squad._teamType].name}`, value: squad._id }; + if (squadId) { + value = _.flatMap(options, o => o.options || o).find(squad => squad.value == squadId); } return ( @@ -70,7 +68,7 @@ class AdminTeamSquadsPage extends Component {