You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Currently, when passing
null
values in thedata
object, the router still includes the parameter in the URL with an empty value.If
value
isnull
, the generated URL will be:This behavior is often undesirable, as empty parameters may cause issues with backend processing or clutter the URL.
Suggested Improvement:
Automatically exclude
null
(and optionallyundefined
) values from being added to the URL.Workaround:
To avoid this, I currently use the following helper function:
Usage:
Expected result:
value
isnull
orundefined
, the URL remainsyourdomain.com
(without?filter_user_id=
).value
has a valid value, it is included as usual.Would it be possible to implement this behavior directly in the router? This would help prevent unnecessary query parameters from being included.
Beta Was this translation helpful? Give feedback.
All reactions