YahooArchive / fluxible-router

MOVED TO FLUXIBLE REPO
104 stars 26 forks source link

Fix rehydrate store for POST routes #99

Closed andersonba closed 8 years ago

andersonba commented 8 years ago

Using a POST route, the RouteStore rehydrates the app using the static GET value as method, so, when I'll open a POST url, the server side renders correctly, but in the client side returns 404 (if you don't defined the same route with GET method).

Now, rehydrate gets the route method from state (state.currentNavigate.method). I had to check if it exists because in error pages (eg. 404) currentNavigate is undefined, so, I use GET as default.

Added unit test to ensure the behavior.

mridgway commented 8 years ago

:+1:

yahoocla commented 8 years ago

CLA is valid!

redonkulus commented 8 years ago

@andersonba now released in 0.3.2. thanks!