logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe
commit: f099bc6091b55c598a55f252041cb3af6043caf4
parent: ffe48fd7c6b970bc9b98bf999535e49572e82035
Author: Eugen Rochko <eugen@zeonfederated.com>
Date:   Mon,  7 Mar 2016 12:58:42 +0100

Adding API for favouriting a status

Diffstat:

Mapp/controllers/api/statuses_controller.rb5+++++
Mconfig/routes.rb1+
2 files changed, 6 insertions(+), 0 deletions(-)

diff --git 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 @@ -26,6 +26,7 @@ Rails.application.routes.draw do resources :statuses, only: [:create, :show] do member do post :reblog + post :favourite end end