Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unused values from default params #13

Merged
merged 3 commits into from
Aug 7, 2024

Conversation

zokioki
Copy link
Owner

@zokioki zokioki commented Aug 7, 2024

Recently, the Fitbit API appears to throw bad request errors if passing empty params to some of its endpoints - in particular it would error out on the activity logs list endpoint as both the beforeDate and afterDate params are being sent over, even though the afterDate param is null by default. Previously, it looks like Fitbit's API would gracefully handle these nil params but in this case it explicitly fails as you can't have both a before and after date set at the same time.

This updates affected methods so that unused values are removed from the default params objects. There should be no difference in behavior other than fixing the recently broken activity logs endpoint.

Addresses #12

Recently, the Fitbit API appears to throw bad request errors
if passing empty params to some of its endpoints - in particular
it would error out on the activity logs list endpoint as both the
beforeDate and afterDate params are being sent over, even though
the afterDate param is null by default. Previously, it looks like
Fitbit's API would gracefully handle these nil params but in this
case it explicitly fails as you can't have both a before and after
date set at the same time.

This updates affected methods so that unused values are removed
from the default params object. There should be no difference in
behavior other than fixing the recently broken activity logs
endpoint.

Addresses #12
@zokioki zokioki merged commit 0a24509 into master Aug 7, 2024
8 checks passed
@zokioki zokioki deleted the remove-empty-default-args branch August 7, 2024 05:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant