lib/pushpad/notification.rb in pushpad-0.11.0 vs lib/pushpad/notification.rb in pushpad-0.11.1

- old
+ new

@@ -36,11 +36,11 @@ @starred = options[:starred] @send_at = options[:send_at] end def self.find(id) - response = Request.get("https://pushpad.xyz/notifications/#{id}") + response = Request.get("https://pushpad.xyz/api/v1/notifications/#{id}") unless response.code == "200" raise FindError, "Response #{response.code} #{response.message}: #{response.body}" end @@ -52,11 +52,11 @@ raise "You must set project_id" unless project_id query_parameters = {} query_parameters[:page] = options[:page] if options.key?(:page) - response = Request.get("https://pushpad.xyz/projects/#{project_id}/notifications", + response = Request.get("https://pushpad.xyz/api/v1/projects/#{project_id}/notifications", query_parameters: query_parameters) unless response.code == "200" raise FindError, "Response #{response.code} #{response.message}: #{response.body}" end @@ -95,10 +95,10 @@ end project_id = options[:project_id] || Pushpad.project_id raise "You must set project_id" unless project_id - endpoint = "https://pushpad.xyz/projects/#{project_id}/notifications" + endpoint = "https://pushpad.xyz/api/v1/projects/#{project_id}/notifications" response = Request.post(endpoint, req_body) unless response.code == "201" raise DeliveryError, "Response #{response.code} #{response.message}: #{response.body}" end