Skip to content

Commit

Permalink
More careful/efficient
Browse files Browse the repository at this point in the history
  • Loading branch information
dumbmatter committed Jan 23, 2025
1 parent 466ea78 commit b48eedc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/worker/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2001,8 +2001,9 @@ export const augmentOffers = async (offers: TradeTeams[]) => {
seasonAttrs: ["won", "lost", "tied", "otl"],
season: g.get("season"),
addDummySeason: true,
active: true,
active: false,

Check failure on line 2004 in src/worker/api/index.ts

View workflow job for this annotation

GitHub Actions / build

Type 'false' is not assignable to type 'true'.
});
const teamsByTid = groupByUnique(teams, "tid");
const stats = bySport({
baseball: ["gp", "keyStats", "war"],
basketball: ["gp", "min", "pts", "trb", "ast", "per"],
Expand All @@ -2014,7 +2015,7 @@ export const augmentOffers = async (offers: TradeTeams[]) => {
return Promise.all(
offers.map(async offerRaw => {
const tid = offerRaw[1].tid;
const t = teams.find(t => t.tid === tid);
const t = teamsByTid[tid];
if (!t) {
throw new Error("No team found");
}
Expand Down

0 comments on commit b48eedc

Please sign in to comment.