Skip to content

Commit

Permalink
Merge pull request #69 from DigitalNZ/pm/improve-featured-stories
Browse files Browse the repository at this point in the history
feat: made featured stories plain objects instead of hash
  • Loading branch information
paul-mesnilgrente authored Jan 23, 2023
2 parents 8913166 + 2f1cb00 commit bf7be6c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/supplejack/story.rb
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,8 @@ def self.find(id, user_key: nil, **params)
# Fetches featured stories
#
def self.featured
get('/stories/featured')
stories = get('/stories/featured')
stories&.map { |story| new(story) }
rescue RestClient::ServiceUnavailable
raise Supplejack::ApiNotAvailable, 'API is not responding'
end
Expand Down

0 comments on commit bf7be6c

Please sign in to comment.