sr-npm 1.7.150 → 1.7.151
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 +1 -1
- package/pages/careersPage.js +11 -2
package/package.json
CHANGED
package/pages/careersPage.js
CHANGED
|
@@ -265,12 +265,21 @@ async function handleDepartmentParam(_$w,department) {
|
|
|
265
265
|
// Debug: Check dropdown options
|
|
266
266
|
|
|
267
267
|
console.log("after refresh");
|
|
268
|
-
|
|
268
|
+
let dropdownOptions = _$w('#dropdownDepartment').options;
|
|
269
269
|
console.log("dropdown options:", dropdownOptions);
|
|
270
270
|
const optionsFromCMS=await wixData.query("AmountOfJobsPerDepartment").find();
|
|
271
271
|
//+1 because of the "All" option
|
|
272
|
+
|
|
272
273
|
if(dropdownOptions.length!==optionsFromCMS.items.length+1){
|
|
273
|
-
|
|
274
|
+
dropdownOptions={
|
|
275
|
+
label: "All",
|
|
276
|
+
value: "RESET_ALL"
|
|
277
|
+
}
|
|
278
|
+
dropdownOptions.push(...optionsFromCMS.items.map(item=>({
|
|
279
|
+
label: item.title,
|
|
280
|
+
value: item.title
|
|
281
|
+
})));
|
|
282
|
+
console.warn("something is wrong with the dropdown options, fixing it");
|
|
274
283
|
}
|
|
275
284
|
|
|
276
285
|
|