From: Eugen Rochko Date: Mon, 7 Mar 2016 11:58:42 +0000 (+0100) Subject: Adding API for favouriting a status X-Git-Url: https://git.xn--scling-oua.cat.family/?a=commitdiff_plain;h=f099bc6091b55c598a55f252041cb3af6043caf4;p=mastodon.git Adding API for favouriting a status --- diff --git a/app/controllers/api/statuses_controller.rb b/app/controllers/api/statuses_controller.rb index 872558f8e..b1633ab6c 100644 --- a/app/controllers/api/statuses_controller.rb +++ b/app/controllers/api/statuses_controller.rb @@ -15,4 +15,9 @@ class Api::StatusesController < ApiController @status = ReblogService.new.(current_user.account, Status.find(params[:id])) render action: :show end + + def favourite + @status = FavouriteService.new.(current_user.account, Status.find(params[:id])).status + render action: :show + end end diff --git a/config/routes.rb b/config/routes.rb index b34837711..98d892fd5 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -26,6 +26,7 @@ Rails.application.routes.draw do resources :statuses, only: [:create, :show] do member do post :reblog + post :favourite end end