kadirahq / flow-router

Carefully Designed Client Side Router for Meteor
MIT License
1.09k stars 195 forks source link

redirect to edit after new #590

Open frankapimenta opened 8 years ago

frankapimenta commented 8 years ago

I have a route for posts, new post and edit post. on edit post route I have a trigger enter to redirect back to posts if Posts.find('id').count < 1. It works fine when we type a bad postId directly in the url (it redirects)

But...

When I create a new post and use the id from the response object of the meteor call that saved the new post to redirect to the edit route, it redirects to posts because the Posts.find('new post id').count() is 0.

How could I redirect to edit route with the id of the newly created post without the enter trigger redirecting me back to posts? why is edit template not subscribing the new post?