Skip to content

Fix TypeScript compilation errors in bots.ts#1

Open
railway-app[bot] wants to merge 1 commit into
mainfrom
railway/code-change-Wu4XXc
Open

Fix TypeScript compilation errors in bots.ts#1
railway-app[bot] wants to merge 1 commit into
mainfrom
railway/code-change-Wu4XXc

Conversation

@railway-app

@railway-app railway-app Bot commented Jul 3, 2026

Copy link
Copy Markdown

Problem

Two TypeScript compilation errors in api/src/routes/bots.ts were blocking the build. On line 70, txline.getOdds() was passed matchId typed as string | string[] (Express's req.params type), but the method only accepts string. On line 109, odds?.homeOdds — typed as number | null per the Odds interface — was used directly in a < comparison without a null guard, which TypeScript rejects.

Solution

Wrapped matchId in String() on line 70 to coerce the string | string[] union to a plain string before passing it to getOdds. On line 109, replaced odds?.homeOdds with (odds?.homeOdds ?? 99) in the ternary comparison, mirroring the same nullish-coalescing pattern already used one line below for the prediction assignment — a null homeOdds now safely falls back to 99 (a high odds value) so the comparison remains semantically correct.

Changes

  • Modified api/src/routes/bots.ts

Generated by Railway

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants