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

make bool of/to_url_query consistent with other types #1

Merged
merged 1 commit into from
Jun 13, 2024

Conversation

tatchi
Copy link
Contributor

@tatchi tatchi commented Jun 13, 2024

Currently, a false boolean value is omitted when transformed to a query param

type t =
  | About of { active : bool }
[@@deriving router]

let () =
  print_endline (Pages.href (About { active = false })) (* /About *)

Now it's being transformed to /About?active=false

If we want to be able to omit the value, we can still use a bool option

@andreypopp andreypopp merged commit 988e159 into andreypopp:main Jun 13, 2024
3 checks passed
@andreypopp
Copy link
Owner

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants