Parametrize setUrlParams utility function to resolve max-params lint error
Description
The setUrlParams utility function is currently triggering a max-params lint error, indicating it has too many parameters. We need to refactor this function to accept a configuration object or use another approach to reduce the parameter count and comply with our linting rules.
Acceptance Criteria
-
Refactor setUrlParamsfunction to use fewer parameters -
Ensure all existing functionality is preserved -
Verify lint error is resolved -
Update any calling code if necessary -
Add/update tests to cover the refactored function
Suggested Solution
Consider refactoring the function to accept a single configuration object instead of multiple individual parameters, or group related parameters into logical objects.
Implementation Guide
- Update the function signature to:
export const setUrlParams = (
params,
{
url = window.location.href,
clearParams = false,
railsArraySyntax = false,
decodeParams = false,
} = {}
) => {
- Update all references/usage.
Description was generated using AI
Edited by 🤖 GitLab Bot 🤖