Skip to content

Commit

Permalink
add default value to task fields in Task#find
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul-Yves committed Nov 7, 2024
1 parent 736856d commit 7978450
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/hubspot/task.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ module Hubspot
class Task
TASKS_PATH = '/crm/v3/objects/tasks'
TASK_PATH = '/crm/v3/objects/tasks/:task_id'
DEFAULT_TASK_FIELDS = 'hs_timestamp,hs_task_body,hubspot_owner_id,hs_task_subject,hs_task_status,hs_task_priority,'\
'hs_task_type,hs_task_reminders'

attr_reader :properties, :id

Expand All @@ -34,7 +36,7 @@ def create!(params = {}, ticket_id: nil)
new(response)
end

def find(task_id, properties)
def find(task_id, properties = DEFAULT_TASK_FIELDS)
response = Hubspot::Connection.get_json(TASK_PATH, { task_id: task_id,
properties: properties })
new(response)
Expand Down

0 comments on commit 7978450

Please sign in to comment.