mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-01 05:50:35 +03:00
Fixed "new post" button showing 500 error when editor beta is enabled (#17926)
refs https://github.com/TryGhost/Ghost/pull/17876 - the redirect added for the beta editor was always redirecting to `lexical-editor.edit` even when accessing `editor.new` which resulted in an incorrect route params error and a 500 screen - switched to redirecting to the correct new/edit route based on the route we're trying to access
This commit is contained in:
parent
d790e25cd9
commit
a4f6a33fee
@ -13,8 +13,14 @@ export default AuthenticatedRoute.extend({
|
||||
beforeModel(transition) {
|
||||
// redirect to the beta editor so the post gets auto-migrated
|
||||
if (this.feature.lexicalEditor) {
|
||||
const {name} = transition.to;
|
||||
const {type, post_id: id} = transition.to.params;
|
||||
return this.router.transitionTo('lexical-editor.edit', type, id);
|
||||
|
||||
if (name === 'editor.new') {
|
||||
return this.router.transitionTo('lexical-editor.new', type);
|
||||
} else if (name === 'editor.edit') {
|
||||
return this.router.transitionTo('lexical-editor.edit', type, id);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user