This website works better with JavaScript.
Home
Explore
Help
Sign In
jyt94
/
closedSocialMastodon
forked from
closed-social/mastodon
Watch
1
Star
0
Fork
0
Code
Issues
0
Pull Requests
0
Projects
0
Releases
0
Wiki
Activity
Browse Source
Adding API for favouriting a status
closed-social-v3
Eugen Rochko
8 years ago
parent
ffe48fd7c6
commit
f099bc6091
2 changed files
with
6 additions
and
0 deletions
Unified View
Diff Options
Show Stats
Download Patch File
Download Diff File
+5
-0
app/controllers/api/statuses_controller.rb
+1
-0
config/routes.rb
+ 5
- 0
app/controllers/api/statuses_controller.rb
View File
@ -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
+ 1
- 0
config/routes.rb
View File
@ -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
Write
Preview
Loading…
Cancel
Save