Skip to content

Commit

Permalink
Merge pull request #951 from HubSpot/redirect-after-submit-new-or-edi…
Browse files Browse the repository at this point in the history
…t-request-form

After submitting or editing a request, redirect to that request's page
  • Loading branch information
ssalinas committed Mar 21, 2016
2 parents f5361fb + 5b56b42 commit 5577619
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions SingularityUI/app/views/requestFormEdit.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ class RequestFormEdit extends RequestFormBaseView
serverRequest.done (response) =>
@lockdown = false
@alert "Your Request <a href='#{ config.appRoot }/request/#{ response.id }'>#{ response.id }</a> has been updated"
Backbone.history.navigate "/request/#{ response.id }", {trigger: true}

serverRequest.error (response) =>
@postSave()
Expand Down
3 changes: 2 additions & 1 deletion SingularityUI/app/views/requestFormNew.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class RequestFormNew extends RequestFormBaseView
serverRequest.done (response) =>
@lockdown = false
@alert "Your Request <a href='#{ config.appRoot }/request/#{ response.id }'>#{ response.id }</a> has been created"
Backbone.history.navigate "/request/#{ response.id }", {trigger: true}

serverRequest.error (response) =>
@postSave()
Expand All @@ -23,4 +24,4 @@ class RequestFormNew extends RequestFormBaseView
console.error response


module.exports = RequestFormNew
module.exports = RequestFormNew

0 comments on commit 5577619

Please # to comment.