0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-24 23:48:13 -05:00

🐛 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 926fd8f01c
commit 377084a60d
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}}