-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2022 refresh #6
2022 refresh #6
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Congrats for the hard work. Just a little nitpicking
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bon je pinaille un peu, mais en soit, y a que la constante à nettoyer qui me freine à envoyer ça.
C'est grave si je commente les PRs en français ?
lib/hubspot/connection.rb
Outdated
if response.success? | ||
response.parsed_response | ||
response | ||
elsif response.not_found? | ||
raise(Hubspot::NotFoundError.new(response)) | ||
else | ||
raise(Hubspot::RequestError.new(response)) | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
github ne me laisse pas faire une suggestion mais bon, on s'la fait guard clause ?
return response if response.success?
response.not_found? ? raise(Hubspot::NotFoundError.new(response)) : raise(Hubspot::RequestError.new(response))
alternative 1
return response if response.success?
error_klass = response.not_found? ? Hubspot::NotFoundError : Hubspot::RequestError
raise error_klass.new(response)
alternative 2
return response if response.success?
raise(Hubspot::NotFoundError.new(response)) if response.not_found?
raise(Hubspot::RequestError.new(response))
@@ -92,12 +92,6 @@ def contacts(opts={}) | |||
end | |||
end | |||
|
|||
# {http://developers.hubspot.com/docs/methods/lists/refresh_list} | |||
def refresh | |||
response = Hubspot::Connection.post_json(REFRESH_PATH, params: { list_id: @id, no_parse: true }, body: {}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
faut virer la constante non ?
Pourquoi on dégage ça en fait ? 🤔 Bon je trouve pas de doc j'imagine que ça n'existe pas.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(tiens ça fait répétition avec le commentaire de Paul-Yves 😅 )
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oui l'endpoint n'existe plus à priori ...
expect(list.id).to be == list1.id | ||
expect(lists.second.id).to be == list2.id | ||
expect(lists.last.id).to be == list3.id |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
un risque qu'un jour ce ne soit pas le même ordre ?
expect(list.id).to be == list1.id | |
expect(lists.second.id).to be == list2.id | |
expect(lists.last.id).to be == list3.id | |
expect(lists.map(&:id)).to contain_exactly(list1.id, list2.id, list3.id) |
👋
Trying to resurrect this lib
demo
api key for POST / PUT requests but that's not allowed anymore, also some ids were hardcoded in the specs, that was fun 😓