Skip to content

Commit

Permalink
instant search URL (custom_fields) - updated
Browse files Browse the repository at this point in the history
  • Loading branch information
iamibrahimriaz committed Feb 18, 2025
1 parent c63d3df commit 840da28
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions assets/js/all-listings.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions assets/src/js/public/components/instantSearch.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,10 @@ import debounce from '../../global/components/debounce';
if (form_data.phone && form_data.phone.length) {
var query = (query && query.length) ? query + '&phone=' + form_data.phone : '?phone=' + form_data.phone;
}
if (form_data.custom_field && form_data.custom_field.length) {
var query = (query && query.length) ? query + '&custom_field=' + form_data.custom_field : '?custom_field=' + form_data.custom_field;
if (form_data.custom_field && Object.keys(form_data.custom_field).length) {
Object.keys(form_data.custom_field).forEach((key) => {
query = (query.length) ? query + `&${key}=${form_data.custom_field[key]}` : `?${key}=${form_data.custom_field[key]}`;
});
}
if (form_data.open_now && form_data.open_now.length) {
var query = (query && query.length) ? query + '&open_now=' + form_data.open_now : '?open_now=' + form_data.open_now;
Expand Down

0 comments on commit 840da28

Please sign in to comment.