Skip to content

Commit

Permalink
Add event attendances endpoints.
Browse files Browse the repository at this point in the history
  • Loading branch information
woodhull committed Jan 12, 2023
1 parent 12a6aab commit e8f68b3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
8 changes: 8 additions & 0 deletions lib/mobilize_america_client/client/events.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,13 @@ def organization_events(organization_id:, timeslot_start: nil, timeslot_end: nil
def organization_event(organization_id:, event_id:)
get(path: "/organizations/#{esc(organization_id)}/events/#{esc(event_id)}")
end

def organization_event_attendances(organization_id:, event_id:)
get(path: "/organizations/#{esc(organization_id)}/events/#{esc(event_id)}/attendances")
end

def create_organization_event_attendance(organization_id:, event_id:, attendance_data:)
post(path: "/organizations/#{esc(organization_id)}/events/#{esc(event_id)}/attendances", body: attendance_data)
end
end
end
6 changes: 5 additions & 1 deletion lib/mobilize_america_client/request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ module Request
API_BASE_PATH = '/v1'.freeze

def get(path:, params: {})
request(method: :get, path: path, params: params)
request(method: :get, path:, params:)
end

def post(path:, body:)
request(method: :post, path:, body:)
end

private
Expand Down

0 comments on commit e8f68b3

Please sign in to comment.