matt HOFFNER commited on
Commit
5f213cb
β€’
1 Parent(s): 5935dee
Files changed (1) hide show
  1. app/tools/odds.ts +2 -3
app/tools/odds.ts CHANGED
@@ -14,7 +14,6 @@ function createOddsApi({ apiKey }: { apiKey: string }) {
14
  const dateFormat = 'iso';
15
  const regions = 'us';
16
  let sportKey;
17
-
18
  let market;
19
 
20
  // americanfootball_nfl_super_bowl_winner
@@ -27,11 +26,11 @@ function createOddsApi({ apiKey }: { apiKey: string }) {
27
  }
28
 
29
  if (input.includes('money line')) {
30
- market = 'spread';
31
  } else if (input.includes('o/u')) {
32
  market = 'totals';
33
  } else {
34
- market = 'spread';
35
  }
36
  const activeSports = await fetch(`https://api.the-odds-api.com/v4/sports/${sportKey}/odds?apiKey=${apiKey}&oddsFormat=${oddsFormat}&dateFormat=${dateFormat}&market=${market}&regions=${regions}`);
37
  const oddsResponse = await activeSports.json();
 
14
  const dateFormat = 'iso';
15
  const regions = 'us';
16
  let sportKey;
 
17
  let market;
18
 
19
  // americanfootball_nfl_super_bowl_winner
 
26
  }
27
 
28
  if (input.includes('money line')) {
29
+ market = 'h2h';
30
  } else if (input.includes('o/u')) {
31
  market = 'totals';
32
  } else {
33
+ market = 'spreads';
34
  }
35
  const activeSports = await fetch(`https://api.the-odds-api.com/v4/sports/${sportKey}/odds?apiKey=${apiKey}&oddsFormat=${oddsFormat}&dateFormat=${dateFormat}&market=${market}&regions=${regions}`);
36
  const oddsResponse = await activeSports.json();