whatadewitt / yahoo-fantasy-sports-api

NodeJS wrapper for the Yahoo! Fantasy Sports API
https://yahoo-fantasy-node-docs.vercel.app/
MIT License
192 stars 52 forks source link

players.league is not a function #88

Closed cheng1994 closed 2 years ago

cheng1994 commented 2 years ago

Attempting to use players.league but encountering a TypeError. Here's a full console ouput

 TypeError: app.yf.players.league is not a function
>      at /home/[computer]/Projects/server/functions/lib/index.js:90:43
>      at Layer.handle [as handle_request] (/home/[computer]/Projects/server/functions/node_modules/express/lib/router/layer.js:95:5)
>      at next (/home/[computer]/Projects/server/functions/node_modules/express/lib/router/route.js:137:13)
>      at Route.dispatch (/home/[computer]/Projects/server/functions/node_modules/express/lib/router/route.js:112:3)
>      at Layer.handle [as handle_request] (/home/[computer]/Projects/server/functions/node_modules/express/lib/router/layer.js:95:5)
>      at /home/[computer]/Projects/server/functions/node_modules/express/lib/router/index.js:281:22
>      at Function.process_params (/home/[computer]/Projects/server/functions/node_modules/express/lib/router/index.js:335:12)
>      at next (/home/[computer]/Projects/server/functions/node_modules/express/lib/router/index.js:275:10)
>      at cors (/home/[computer]/Projects/server/functions/node_modules/cors/lib/index.js:188:7)
>      at /home/[computer]/Projects/server/functions/node_modules/cors/lib/index.js:224:17
whatadewitt commented 2 years ago

On it!

whatadewitt commented 2 years ago

Wait a sec, you should be using leagues if you're using the players collceion

players.leagues should work!

https://yahoo-fantasy-node-docs.vercel.app/collection/players/league