diericx / climbing_notebook

A tool to help climbers with their training
https://climbingnotebook.com
Other
22 stars 1 forks source link

Better `redirect_to` handling for form actions #9

Closed diericx closed 1 year ago

diericx commented 1 year ago

Right now redirect_to is handled in every action. It would be nice to refactor this out in some way so the developer doesn't have to worry at all about this... maybe in the hook or something?

I believe I tried this a while back and there was some issue with separating between entering a form action and handling the response to a successful form action. We would only want to redirect on the latter case.

I had previously done this by creating an enhance function for actions but this would lose the types from Svelte. Not sure how to do this while maintaining these useful form action types.

diericx commented 1 year ago

Now handled in hooks!