Created
December 29, 2021 15:31
-
-
Save fmundaca/36a819f9672a5ecc720d7ca4612d1a70 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def fetch_open_surveys(survey_ids) | |
return [] if survey_ids.empty? | |
params = { survey_featured: survey_ids } | |
response = ::RestClient.get("#{FORMS_URL}?#{params.to_query}", headers) | |
data = JSON.parse(response.body, symbolize_names: true) | |
data[:surveys] | |
rescue | |
[] | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment