Skip to content
Snippets Groups Projects
Commit f099bc60 authored by Eugen Rochko's avatar Eugen Rochko
Browse files

Adding API for favouriting a status

parent ffe48fd7
No related branches found
No related tags found
No related merge requests found
...@@ -15,4 +15,9 @@ class Api::StatusesController < ApiController ...@@ -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 ...@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment