diff --git a/app/controllers/reshares_controller.rb b/app/controllers/reshares_controller.rb index 8b0ba88f3..2b21b66ab 100644 --- a/app/controllers/reshares_controller.rb +++ b/app/controllers/reshares_controller.rb @@ -9,6 +9,6 @@ class ResharesController < ApplicationController current_user.dispatch_post(@reshare, :url => post_url(@reshare), :additional_subscribers => @reshare.root.author) end - render :json => @reshare.as_api_response(:backbone), :status => 201 + render :json => PostPresenter.new(@reshare.root, current_user).to_json, :status => 201 end end diff --git a/public/javascripts/app/views/feedback_view.js b/public/javascripts/app/views/feedback_view.js index 71d71b802..ec412a920 100644 --- a/public/javascripts/app/views/feedback_view.js +++ b/public/javascripts/app/views/feedback_view.js @@ -34,10 +34,15 @@ app.views.Feedback = app.views.Base.extend({ if(evt) { evt.preventDefault(); } if(!window.confirm("Reshare " + this.model.reshareAuthor().name + "'s post?")) { return } var reshare = this.model.reshare() + var model = this.model + reshare.save({}, { url: this.model.createReshareUrl, - success : function(){ - app.stream.add(reshare); + success : function(resp){ + app.stream && app.stream.add(reshare); + + model.set(resp.get("post")) + model.trigger("feedback") } }); },