3

I am using react router to change url as below.

browserHistory.push({ pathname: npathname, query: {
    checkin : checkin,
    checkout : checkout,
    managed_by : 'Owner',
    managed_by : 'Manager',
} });

As you see here I want to pass 2 values of query parameter, but it overwrites the first value by second. How can I pass both the values of query parameter?

3
  • Have you tried making managed_by an array like so: managed_by: ['Owner', 'Manager']? Commented Dec 28, 2016 at 20:04
  • Works, great thanks. Commented Dec 28, 2016 at 20:14
  • Can u write in answer so I can mark it as correct answer? Commented Dec 28, 2016 at 20:16

1 Answer 1

2

Set the managed_by property as an array like this:

browserHistory.push({ pathname: npathname, query: {
    checkin : checkin,
    checkout : checkout,
    managed_by : ['Owner','Manager']
} });
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.