Skip to content

Commit 36db307

Browse files
committed
add wrapper to countries
1 parent b9789de commit 36db307

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

lib/ruby_api_pack_cloudways/api/cw_lists.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ def self.backup_frequency_list
3333

3434
# Fetch list of supported countries
3535
def self.country_list
36-
validate_response(fetch_resource(ENDPOINTS[:countries]), 'countries')
36+
response = fetch_resource(ENDPOINTS[:countries])
37+
wrapped_response = { 'countries' => response } if response.is_a?(Array)
38+
validate_response(wrapped_response || response, 'countries')
3739
end
3840

3941
# Fetch list of monitoring durations

0 commit comments

Comments
 (0)