lib/book-value/client.rb in book-value-0.0.5 vs lib/book-value/client.rb in book-value-0.0.6
- old
+ new
@@ -69,11 +69,12 @@
end
feature_params = feature_params[0..-2]
milage_form_page = authorise_and_send(http_method: :post, payload: feature_params, command: "calculate/#{make.downcase}/#{model_name}")
+ next unless milage_form_page['metadata']['ok']
+
condition_url = milage_form_page['headers']['location']
- next unless condition_url
_condition_page = HTTParty.post(condition_url, body: "mileage=#{mileage}&year=#{year}")
book_value_url = condition_url.gsub('/4', '/5')
book_value_page = HTTParty.post(book_value_url, body: "condition_score=#{condition_score}")