Closed Yuvix25 closed 8 months ago
Looks like you are calling the plural of athletes
when you intend the singular athlete
.
The singular version doesn't take an id
at all because it gets the authenticated athlete details.
https://developers.strava.com/docs/reference/#api-Athletes-getStats
If something could be improved about the code or docs, feel free to submit a PR, but since the wrong method name appears to have been called here, I'm closing this.
No. I am calling the correct plural athletes
.
Please review the API docs.
https://developers.strava.com/docs/reference/
I see no method to get the details of an arbitrary athlete.
You're right, it doesn't exist. In that case, this line should probably be removed: https://github.com/node-strava/node-strava-v3/blob/5b2d9ad1c102716a7b8131b69e53df914e1c6556/lib/athletes.js#L6 I got confused by its existence (thought this was an actual endpoint), and I'm sure many others also will.
This is a community-maintained project and a PR would be welcome that cleans up any code and docs that are out of sync or confusing. See also #142 and #149.
There's a comment in the docs about passing an id
to athletes.get(), but I think the intent was actually to add that comment to
activity.get()`.
The original author is no longer active and there is no one else standing by to fix issues for other people. The module will improve to the extent that users are willing to contribute improvements.
Yep, a PR is where I'm going with this. Just opened this issue first to make sure I wasn't missing anything (which I was, so good thing I did it before PRing 🙂)
Might also fill a few other type annotations while I'm at it, too many any
s in the index.d.ts
file for my liking 😁
Tightening the types would be welcome as well.
When attempting to retrieve an athlete with:
I get the following error:
There appears to be a mismatch between the types file: https://github.com/node-strava/node-strava-v3/blob/5b2d9ad1c102716a7b8131b69e53df914e1c6556/index.d.ts#L152 And the actual code: https://github.com/node-strava/node-strava-v3/blob/5b2d9ad1c102716a7b8131b69e53df914e1c6556/lib/athletes.js#L20