🐛 Fixed redirect to posts list when deleting a page (#1486)

no issue

- success routine when deleting a post/page was not taking into consideration the type of record being deleted
  - deleting a post should keep previous behaviour of redirecting to posts list
  - deleting a page should redirect to the pages list
This commit is contained in:
André Borud 2020-02-27 16:19:31 +01:00 committed by GitHub
parent 941ec4bc5f
commit ee02b81999
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -66,8 +66,8 @@ export default AuthenticatedRoute.extend(ShortcutsRoute, {
this.controller.send('toggleReAuthenticateModal');
},
redirectToContentScreen() {
this.transitionTo('posts');
redirectToContentScreen(displayName) {
this.transitionTo(displayName === 'page' ? 'pages' : 'posts');
},
willTransition(transition) {

View File

@ -94,7 +94,7 @@
{{#if this.showDeletePostModal}}
<GhFullscreenModal @modal="delete-post"
@model={{hash post=this.post onSuccess=(route-action 'redirectToContentScreen')}}
@model={{hash post=this.post onSuccess=(route-action 'redirectToContentScreen' this.post.displayName)}}
@close={{action "toggleDeletePostModal"}}
@modifier="action wide" />
{{/if}}