mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-04-08 02:52:39 -05:00
🐛 Fixed redirect for pages causing 404
closes #10649 - `resourceType` in API v0.1 is only of 'post' type. Because in admin we now distinguish between 2 types of editable resources: 'posts' and 'page' the redirect has to be based on 'entry.page' flag
This commit is contained in:
parent
1facbc5c02
commit
2253b2d18c
1 changed files with 3 additions and 1 deletions
|
@ -32,7 +32,9 @@ module.exports = function entryController(req, res, next) {
|
|||
// CASE: last param is of url is /edit, redirect to admin
|
||||
if (lookup.isEditURL) {
|
||||
debug('redirect. is edit url');
|
||||
return urlService.utils.redirectToAdmin(302, res, `/editor/${res.routerOptions.resourceType.replace(/s$/, '')}/${entry.id}`);
|
||||
const resourceType = entry.page ? 'page' : 'post';
|
||||
|
||||
return urlService.utils.redirectToAdmin(302, res, `/editor/${resourceType}/${entry.id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue