sr-npm 1.7.156 → 1.7.157

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.156",
3
+ "version": "1.7.157",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -271,9 +271,19 @@ async function handleDepartmentParam(_$w,department) {
271
271
  fixDropdownOptions(optionsFromCMS, _$w);
272
272
  }
273
273
 
274
- _$w('#dropdownDepartment').value = departmentValue;
274
+ if (_$w('#dropdownDepartment').options.find(option => option.value === departmentValue))
275
+ {
276
+ _$w('#dropdownDepartment').value = departmentValue;
277
+ await applyFilters(_$w, true); // Skip URL update since we're handling initial URL params
278
+ }
279
+ else{
280
+ console.log("department value not found in dropdown options");
281
+ queryParams.remove(["department" ]);
282
+
283
+ }
284
+
275
285
 
276
- await applyFilters(_$w, true); // Skip URL update since we're handling initial URL params
286
+
277
287
  }
278
288
 
279
289
  function fixDropdownOptions(optionsFromCMS, _$w){
package/pages/homePage.js CHANGED
@@ -48,6 +48,13 @@ function init(_$w) {
48
48
 
49
49
  _$w('#searchInput').onInput(debouncedInput);
50
50
  _$w('#searchInput').maxLength = 40;
51
+ _$w('#button1').onClick(()=>{
52
+ const trimmedInput = _$w('#searchInput').value.trim();
53
+ if (trimmedInput) {
54
+ location.to(`/positions?keyWord=${trimmedInput}`);
55
+ }
56
+ });
57
+
51
58
 
52
59
  _$w('#searchInput').onKeyPress((event) => {
53
60
  if (event.key === 'Enter') {