defer comments posting in comment controller
This commit is contained in:
parent
1d19dba9b4
commit
5914ed4ef1
1 changed files with 3 additions and 4 deletions
|
|
@ -15,7 +15,7 @@ class CommentsController < ApplicationController
|
|||
end
|
||||
|
||||
def create
|
||||
target = current_user.find_visible_shareable_by_id Post, params[:post_id]
|
||||
target = current_user.find_visible_shareable_by_id(Post, params[:post_id])
|
||||
text = params[:text]
|
||||
|
||||
if target
|
||||
|
|
@ -24,7 +24,7 @@ class CommentsController < ApplicationController
|
|||
if @comment.save
|
||||
Rails.logger.info("event => :create, :type => :comment, :user => #{current_user.diaspora_handle},
|
||||
:status => :success, :comment => #{@comment.id}, :chars => #{params[:text].length}")
|
||||
Postzord::Dispatcher.build(current_user, @comment).post
|
||||
current_user.dispatch_post(@comment)
|
||||
|
||||
respond_to do |format|
|
||||
format.json{ render :json => @comment.as_api_response(:backbone), :status => 201 }
|
||||
|
|
@ -51,8 +51,7 @@ class CommentsController < ApplicationController
|
|||
else
|
||||
respond_to do |format|
|
||||
format.mobile {redirect_to :back}
|
||||
format.js {render :nothing => true, :status => 403}
|
||||
format.json { render :nothing => true, :status => 403 }
|
||||
format.any(:js, :json) {render :nothing => true, :status => 403}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue