-
Notifications
You must be signed in to change notification settings - Fork 51
[bug] imgur.saveClient
not working as per docs
#162
Comments
Once I get your approval @kaimallea I can work on this issue and send a PR :) |
imgur.saveClient
not working as per docs
imgur.saveClient
not working as per docsimgur.saveClient
not working as per docs
@swarajpure hey, thanks for the thorough issue! All PRs are welcome, would love for you to send in a PR fixing this. Out of curiousity, would it be easier for you if you passed in the client id from an environment variable, rather than saving it to disk? e.g., imgur.setClientId(process.env.IMGUR_CLIENTID);`. Also feel free to ignore my suggestion and send a PR. :) |
Thanks! Please let me know whether I should implement the long fix or the short fix. Modifying the library function might cause tests to break (if any). Just wanted to confirm once before I send in a PR 😉
Yes, when I was trying it, I was loading the clientId from the environment variables only 🙂 |
Oh, I see there is no test for I guess then modifying the library function |
@swarajpure since v1.x is in maintenance/support mode, I'd prefer to limit the change to a fix/patch rather than a new feature or breaking change that would require a minor or major version bump |
saveClient function expects two arguments and according to the documentation, we were passing only one which resulted in errors. fix kaimallea#162
🎉 This issue has been resolved in version 1.0.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
As per the documentation:
If we continue just like this, we get the error:
Reason:
imgur.saveClientId
function expects two arguments:clientId
andpath
and we're passing only one that too wrong one. Why wrong?clientId
is supposed to be the first argument and thenpath
What's the fix?
Short:
saveClientId('aCs53GSs4tga0ikp', null)
Long:
imgur.saveClientId
to be an object and pass path asnull
Something like:
saveClientId({ clientId: 'aCs53GSs4tga0ikp' })
I was struggling for some time with this issue and then finally after looking the library functions could I find the problem. Would be better if we can fix this. I know people can use the v2 but there will be people who would be using v1 as it's stable.
Thank you! 😄
The text was updated successfully, but these errors were encountered: