Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve parameter mapping functionality #122

Open
woylie opened this issue Oct 2, 2022 · 0 comments
Open

improve parameter mapping functionality #122

woylie opened this issue Oct 2, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@woylie
Copy link
Owner

woylie commented Oct 2, 2022

By default, Flop.Phoenix puts all parameters into the query parameters when building URLs. This can overridden by passing a custom URL builder function since version 0.15, allowing you to map flop parameters to other URL structures (e.g. /categories/{category_id}/posts/{page}?s={search_term}). However, when you handle the parameters map in a controller function or in handle_params/3, you need convert those parameters back to the parameter format that Flop understands. Flop.nest_filters/3 and Flop.map_to_filter_params/2 can partially help with that, but it is still more effort than it should be. Also, you'll have to define both the URL builder and the URL parser function.

It would be great to have some way to define the URL mapping once in a concise format, and have Flop.Phoenix do the building/parsing for you.

@woylie woylie added the enhancement New feature or request label Oct 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant