breeku / trackmania-api-node

npm module for Trackmania2020 API
https://trackmania-api-node.netlify.app/
MIT License
13 stars 3 forks source link

Added getClubCampaignById #30

Closed Sigeth closed 3 years ago

Sigeth commented 3 years ago

getClubCampaignById allows to access to a campaign using its club ID and its campaign ID.

Here are the changes :

Thanks for reading it and please let me know if I need to fix things ! (if you want an example of the JSON that is returning, just ask me, but I think it's the same as campaigns from getClubCampaigns)

breeku commented 3 years ago

Hey,

thanks for the pr!

there's some funky stuff here though.


Here are the changes :

    live-services.js : from line 88 to line 111
    live-services.d.ts : from line 40 to line 51 and from line 286 to line 299

this is not reflected in the pr, since there is a diff of

+571
-656

atleast some of this seems to be due to not using prettier, look into installing that extension to your editor.

why is live-services.spec.ts overwritten with types and function definitions?

in live-services.ts there's some new weird imports and all functions are moved from export const to exports? also there is some source mapping at the end of file


the getClubCampaignById function by itself look's like it should work though, there's just some weird stuff happening otherwise.

are you sure you are making changes to the source and not the built files? there should not be .d.ts in the source

Sigeth commented 3 years ago

Ok so, just to ask : Why do I need to change in order to make a new function ? Do I need to create a new interface or smth ? I think I'll wait your comment, then close this PR and open another one with less weird things I think

Sigeth commented 3 years ago

I'm closing it, I'll make another PR today I think or in the next days

breeku commented 3 years ago

Hey, sorry it's taking time to answer, busy times.

In nutshell, you need to clone the repository, and then edit the files in ./src/ directory. Look at the other functions for direction how they are constructed.