Closed FahdW closed 4 years ago
Which call, specifically? It appears to be working fine for me...
@FahdW @whatadewitt I think the docs and the app just need to be updated to reflect the current version.. For example, the docs say to pass in an array for League Key like so..
yf.players.leagues([leagueKey], { start: 0 }, [], (err, data) => {
// do your thing
})
However, in the current version, league key just needs to be a string (or a string containing multiple league keys separated by commas) like this..
yf.players.leagues(leagueKey, { start: 0 }, [], (err, data) => {
// do your thing
})
This is what the current version is doing with the league key when trying to pull in players from a particular league
https://github.com/whatadewitt/yfsapi/blob/master/collections/playersCollection.mjs#L48
I’m replying on my phone, but I think it’s just a simple misunderstanding, or maybe I’m so tired I don’t know what’s what right now, but you can pass a single league key as a string, or an array of league keys. The sandbox app takes the comma separated list of strings and converts that to an array when it’s POSTs to the server and the library handles it from there... am I making any sense or am I just way off?
On Sun, Jul 22, 2018 at 6:57 PM lsbyerley notifications@github.com wrote:
@FahdW https://github.com/FahdW @whatadewitt https://github.com/whatadewitt I think the docs just need to be updated to reflect the current version.. For example, the docs say to pass in an array for League Key like so..
yf.players.leagues([leagueKey], { start: 0 }, [], (err, data) => { // do your thing })
However, in the current version, league key just needs to be a string (or a string containing multiple league keys separated by commas) like this..
yf.players.leagues(leagueKey, { start: 0 }, [], (err, data) => { // do your thing })
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/whatadewitt/yfsapi/issues/46#issuecomment-406899985, or mute the thread https://github.com/notifications/unsubscribe-auth/AAWM0uuFpfU6si5Pll4ASjgsAwS-qMxlks5uJPU1gaJpZM4VGewH .
@whatadewitt Your making sense, all I'm saying is when running this request..
yf.players.leagues([leagueKey], { start: start }, function(err, data) {
//stuff
})
On version 3.0.3
, I get a args.shift(...).split is not a function
error at this line https://github.com/whatadewitt/yfsapi/blob/master/collections/playersCollection.mjs#L48
However, if I just pass in a string instead of an array, like so, it works..
yf.players.leagues(leagueKey, { start: start }, function(err, data) {
//stuff
})
I'm finally about to push a fix for this. Sorry for the delay, life with a newborn is tough!
No worries! Congrats on the new addition to the family!
Hey i just wanted to test your library out i was trying to extract some data out from a league and everytime i run it it crashes the entire heroku