Skip to content

Commit

Permalink
Return full response body when fetching categories
Browse files Browse the repository at this point in the history
  • Loading branch information
mikepack committed Feb 15, 2021
1 parent 74c423c commit ecf3760
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/discourse_api/api/categories.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def delete_category(id)

def categories(params = {})
response = get('/categories.json', params)
response[:body]['category_list']['categories']
response[:body]
end

def category_latest_topics(args = {})
Expand All @@ -52,7 +52,7 @@ def category_latest_topics(args = {})
if response[:body]['errors']
response[:body]['errors']
else
response[:body]['topic_list']['topics']
response[:body]
end
end

Expand All @@ -61,13 +61,13 @@ def category_top_topics(category_slug)
if response[:body]['errors']
response[:body]['errors']
else
response[:body]['topic_list']['topics']
response[:body]
end
end

def category_new_topics(category_slug)
response = get("/c/#{category_slug}/l/new.json")
response[:body]['topic_list']['topics']
response[:body]
end

def category(id)
Expand Down

0 comments on commit ecf3760

Please sign in to comment.