client/posts: fix post edit route

This commit is contained in:
rr- 2016-07-17 19:00:30 +02:00
parent 2a39ec165d
commit 651c3f6925
1 changed files with 5 additions and 2 deletions

View File

@ -163,8 +163,11 @@ module.exports = router => {
router.enter('/post/:id/edit/:parameters?',
(ctx, next) => { misc.parseUrlParametersRoute(ctx, next); },
(ctx, next) => {
ctx.controller = new PostController(
ctx.parameters.id, true, ctx.parameters);
// restore parameters from history state
if (ctx.state.parameters) {
Object.assign(ctx.parameters, ctx.state.parameters);
}
ctx.controller = new PostController(ctx.parameters.id, true, ctx);
});
router.enter(
'/post/:id/:parameters?',