Skip to content

Commit

Permalink
removed leading slashes from endpoints, to prevent double slashes (#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
bverbeken authored Nov 30, 2023
1 parent 88f30e4 commit b158bbf
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions lib/seatsio/events.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def create_multiple(key: nil, event_creation_params: nil)

def update(key:, chart_key: nil, event_key: nil, name: nil, date: nil, table_booking_config: nil, object_categories: nil, categories: nil, is_in_the_past: nil)
payload = build_event_request(chart_key, event_key, name, date, table_booking_config, object_categories, categories, channels: nil, is_in_the_past: is_in_the_past)
@http_client.post("/events/#{key}", payload)
@http_client.post("events/#{key}", payload)
end

def override_season_object_status(key:, objects:)
Expand Down Expand Up @@ -117,7 +117,7 @@ def release(event_key_or_keys, object_or_objects, hold_token: nil, order_id: nil
end

def delete(key:)
@http_client.delete("/events/#{key}")
@http_client.delete("events/#{key}")
end

def retrieve(key:)
Expand All @@ -133,12 +133,12 @@ def list_status_changes(key, object_id = nil)
if object_id != nil
status_changes_for_object key: key, object_id: object_id
else
Pagination::Cursor.new(StatusChange, "/events/#{key}/status-changes", @http_client)
Pagination::Cursor.new(StatusChange, "events/#{key}/status-changes", @http_client)
end
end

def status_changes_for_object(key:, object_id:)
Pagination::Cursor.new(StatusChange, "/events/#{key}/objects/#{object_id}/status-changes", @http_client)
Pagination::Cursor.new(StatusChange, "events/#{key}/objects/#{object_id}/status-changes", @http_client)
end

def mark_as_not_for_sale(key:, objects: nil, area_places: nil, categories: nil)
Expand Down
4 changes: 2 additions & 2 deletions lib/seatsio/hold_tokens.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ def create(expires_in_minutes: nil)
end

def retrieve(hold_token)
response = @http_client.get("/hold-tokens/#{hold_token}")
response = @http_client.get("hold-tokens/#{hold_token}")
HoldToken.new(response)
end

def expire_in_minutes(hold_token, expires_in_minutes = nil)
body = {"expiresInMinutes": expires_in_minutes}
response = @http_client.post("/hold-tokens/#{hold_token}", body)
response = @http_client.post("hold-tokens/#{hold_token}", body)
HoldToken.new(response)
end
end
Expand Down
8 changes: 4 additions & 4 deletions lib/seatsio/seasons.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def create_partial_season(top_level_season_key:, partial_season_key: nil, event_
request = {}
request['key'] = partial_season_key if partial_season_key
request['eventKeys'] = event_keys if event_keys
response = @http_client.post("/seasons/#{top_level_season_key}/partial-seasons", request)
response = @http_client.post("seasons/#{top_level_season_key}/partial-seasons", request)
Season.new(response)
end

Expand All @@ -36,19 +36,19 @@ def create_events(key:, number_of_events: nil, event_keys: nil)
request = {}
request['eventKeys'] = event_keys if event_keys
request['numberOfEvents'] = number_of_events if number_of_events
response = @http_client.post("/seasons/#{key}/actions/create-events", request)
response = @http_client.post("seasons/#{key}/actions/create-events", request)
Events.new(response).events
end

def add_events_to_partial_season(top_level_season_key:, partial_season_key:, event_keys:)
request = {}
request['eventKeys'] = event_keys
response = @http_client.post("/seasons/#{top_level_season_key}/partial-seasons/#{partial_season_key}/actions/add-events", request)
response = @http_client.post("seasons/#{top_level_season_key}/partial-seasons/#{partial_season_key}/actions/add-events", request)
Season.new(response)
end

def remove_event_from_partial_season(top_level_season_key:, partial_season_key:, event_key:)
response = @http_client.delete("/seasons/#{top_level_season_key}/partial-seasons/#{partial_season_key}/events/#{event_key}")
response = @http_client.delete("seasons/#{top_level_season_key}/partial-seasons/#{partial_season_key}/events/#{event_key}")
Season.new(response)
end

Expand Down
2 changes: 1 addition & 1 deletion lib/seatsio/workspaces.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def inactive(filter: nil)
end

def retrieve(key:)
response = @http_client.get("/workspaces/#{key}")
response = @http_client.get("workspaces/#{key}")
Workspace.new(response)
end

Expand Down

0 comments on commit b158bbf

Please sign in to comment.