Skip to content

Commit

Permalink
Merge pull request #13 from zokioki/remove-empty-default-args
Browse files Browse the repository at this point in the history
Remove unused values from default params
  • Loading branch information
zokioki authored Aug 7, 2024
2 parents 809fdcf + 344dd7a commit 0a24509
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 4 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
1.0.1
-----
- Remove unused values from default params for the following:
- activity_logs_list
- ecg_logs_list
- sleep_logs_list
- Fixes bad request errors for `activity_logs_list` endpoint.

1.0.0
-----
- BREAKING: Upgrade `oauth2` dependency to v2.0
Expand Down
2 changes: 1 addition & 1 deletion lib/fitbit_api/activities.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def all_activities
# @option params :limit [Integer] The max of the number of entries returned (max: 20)

def activity_logs_list(params = {})
default_params = { before_date: Date.today, after_date: nil, sort: 'desc', limit: 20, offset: 0 }
default_params = { before_date: Date.today, sort: 'desc', limit: 20, offset: 0 }
get("user/#{user_id}/activities/list.json", default_params.merge(params))
end

Expand Down
2 changes: 1 addition & 1 deletion lib/fitbit_api/electrocardiogram.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class Client
# @option params :limit [Integer] The max of the number of entries returned (max: 10)

def ecg_logs_list(params = {})
default_params = { before_date: Date.today, after_date: nil, sort: 'desc', limit: 10, offset: 0 }
default_params = { before_date: Date.today, sort: 'desc', limit: 10, offset: 0 }
get("user/#{user_id}/ecg/list.json", default_params.merge(params))
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/fitbit_api/sleep.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def sleep_logs_by_date_range(opts = {})
# @option params :limit [Integer] The max of the number of entries returned (max: 100)

def sleep_logs_list(params = {})
default_params = { before_date: Date.today, after_date: nil, sort: 'desc', limit: 20, offset: 0 }
default_params = { before_date: Date.today, sort: 'desc', limit: 20, offset: 0 }
get("user/#{user_id}/sleep/list.json", default_params.merge(params))
end

Expand Down
2 changes: 1 addition & 1 deletion lib/fitbit_api/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module FitbitAPI
VERSION = '1.0.0'
VERSION = '1.0.1'
end

0 comments on commit 0a24509

Please sign in to comment.