sr-npm 1.7.1021 → 1.7.1022

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sr-npm",
3
- "version": "1.7.1021",
3
+ "version": "1.7.1022",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -121,7 +121,9 @@ async function handleParams(_$w,param,values) {
121
121
  console.log("field: ",field);
122
122
  let existing = selectedByField.get(field._id) || [];
123
123
  for(const value of valuesAsArray) {
124
+ console.log("value: ",value);
124
125
  const decodedValue = decodeURIComponent(value);
126
+ console.log("decodedValue: ",decodedValue);
125
127
  const options=optionsByFieldId.get(field._id);
126
128
  console.log("options: ",options);
127
129
  const option=getCorrectOption(decodedValue,options);
@@ -2,6 +2,7 @@ const { items: wixData } = require('@wix/data');
2
2
  const { JOBS_COLLECTION_FIELDS,COLLECTIONS } = require('../backend/collectionConsts');
3
3
  const { CAREERS_MULTI_BOXES_PAGE_CONSTS,CATEGORY_CUSTOM_FIELD_ID_IN_CMS } = require('../backend/careersMultiBoxesPageIds');
4
4
  const { location } = require("@wix/site-location");
5
+ const { normalizeString } = require('../backend/utils');
5
6
 
6
7
  function groupValuesByField(values, refKey) {
7
8
  const map = new Map();
@@ -63,13 +64,14 @@ function groupValuesByField(values, refKey) {
63
64
  }
64
65
 
65
66
  function getCorrectOption(value,options) {
66
- const standardizedValue = value.toLowerCase().trim().replace(/[^a-z0-9]/gi, '');
67
- return options.find(option=>option.label.toLowerCase().trim().replace(/[^a-z0-9]/gi, '')===standardizedValue);
67
+ const standardizedValue = normalizeString(value.toLowerCase())
68
+ return options.find(option=>normalizeString(option.label.toLowerCase())===standardizedValue);
68
69
  }
69
70
 
70
71
  function getOptionIndexFromCheckBox(options,value) {
72
+ const normalizedValue=normalizeString(value.toLowerCase());
71
73
  for(let index=0;index<options.length;index++) {
72
- if(options[index].value===value) {
74
+ if(normalizeString(options[index].value.toLowerCase())===normalizedValue) {
73
75
  return index;
74
76
  }
75
77
  }