Skip to content

Commit

Permalink
Merge 6435b95 into 2da3340
Browse files Browse the repository at this point in the history
  • Loading branch information
jhass committed Jan 30, 2020
2 parents 2da3340 + 6435b95 commit 48f2fda
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/controllers/api/v1/comments_controller.rb
Expand Up @@ -8,7 +8,7 @@ class CommentsController < Api::V1::BaseController
end

before_action only: %i[create destroy] do
require_access_token %w[interactions public:modify]
require_access_token %w[interactions public:read]
end

rescue_from ActiveRecord::RecordNotFound do
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/api/v1/likes_controller.rb
Expand Up @@ -31,7 +31,7 @@ def show

def create
post = post_service.find!(params.require(:post_id))
raise ActiveRecord::RecordInvalid unless post.public? || private_modify?
raise ActiveRecord::RecordInvalid unless post.public? || private_read?

like_service.create(params[:post_id])
rescue ActiveRecord::RecordInvalid => e
Expand All @@ -45,7 +45,7 @@ def create

def destroy
post = post_service.find!(params.require(:post_id))
raise ActiveRecord::RecordInvalid unless post.public? || private_modify?
raise ActiveRecord::RecordInvalid unless post.public? || private_read?

success = like_service.unlike_post(params[:post_id])
if success
Expand Down

0 comments on commit 48f2fda

Please sign in to comment.