mirror of
https://github.com/mastodon/mastodon.git
synced 2024-12-22 23:20:44 +01:00
Adding API for favouriting a status
This commit is contained in:
parent
ffe48fd7c6
commit
f099bc6091
2 changed files with 6 additions and 0 deletions
|
@ -15,4 +15,9 @@ class Api::StatusesController < ApiController
|
||||||
@status = ReblogService.new.(current_user.account, Status.find(params[:id]))
|
@status = ReblogService.new.(current_user.account, Status.find(params[:id]))
|
||||||
render action: :show
|
render action: :show
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def favourite
|
||||||
|
@status = FavouriteService.new.(current_user.account, Status.find(params[:id])).status
|
||||||
|
render action: :show
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -26,6 +26,7 @@ Rails.application.routes.draw do
|
||||||
resources :statuses, only: [:create, :show] do
|
resources :statuses, only: [:create, :show] do
|
||||||
member do
|
member do
|
||||||
post :reblog
|
post :reblog
|
||||||
|
post :favourite
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue