Skip to content

Commit

Permalink
add "favorite topic" api
Browse files Browse the repository at this point in the history
  • Loading branch information
qichunren committed Apr 20, 2012
1 parent f2a151c commit c663fbc
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/api.rb
Expand Up @@ -70,6 +70,16 @@ class API < Grape::API
end
end

# Mark a topic as favorite for current authenticated user
# Example
# /api/user/favorite/qichunren/8.json?token=232332233223:1
resource :user do
put "favorite/:user/:topic" do
authenticate!
current_user.favorite_topic(params[:topic])
end
end

resource :users do
# Get top 20 hot users
# Example
Expand Down

0 comments on commit c663fbc

Please sign in to comment.