-
Notifications
You must be signed in to change notification settings - Fork 43
Dynamic room type selection #1236
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
Conversation
| for (let i = 0; i < urlParamNames.length; i++){ | ||
| const paramName = urlParamNames[i]; | ||
| const urlParamValue = urlParams[paramName]; | ||
| const newRoomType = urlParamValue && _roomTypeMapping[paramName] && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this returning a string or a boolean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A string - if it exists at the index
| if (!_defaultRoomType) { | ||
| return ''; | ||
| } | ||
| const urlParamNames = Object.keys(urlParams); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any reason why not using forEach from here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can't break out of a for each, so you'd have to loop through the entire array and then return the found value. This way we can exit the loop as soon as a match is found
Code change in rooms to allow for more granular roomType selection based on provided url parameters