sr-npm 1.7.504 → 1.7.505

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/backend/data.js CHANGED
@@ -40,7 +40,7 @@ async function filterBasedOnBrand(positions) {
40
40
  } catch (error) {
41
41
  if(error.message==="[getTokenFromCMS], No desiredBrand found")
42
42
  {
43
- console.warn(error.message)
43
+ console.log("no desiredBrand found, fetching all positions")
44
44
  return positions.content;
45
45
  }
46
46
  throw error;
@@ -373,7 +373,8 @@ async function clearCollections() {
373
373
  await Promise.all([
374
374
  wixData.truncate(COLLECTIONS.CITIES),
375
375
  wixData.truncate(COLLECTIONS.AMOUNT_OF_JOBS_PER_DEPARTMENT),
376
- wixData.truncate(COLLECTIONS.JOBS)
376
+ wixData.truncate(COLLECTIONS.JOBS),
377
+ wixData.truncate(COLLECTIONS.BRANDS)
377
378
  ]);
378
379
  console.log("cleared collections successfully");
379
380
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sr-npm",
3
- "version": "1.7.504",
3
+ "version": "1.7.505",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -3,6 +3,7 @@ const {wixData} = require('wix-data');
3
3
  const { window } = require('@wix/site-window');
4
4
  const { query,queryParams,onChange} = require("wix-location-frontend");
5
5
  const { location } = require("@wix/site-location");
6
+ const { COLLECTIONS } = require('../backend/collectionConsts');
6
7
 
7
8
  const {
8
9
  debounce,
@@ -441,7 +442,7 @@ async function handleBrandParam(_$w,brand){
441
442
  const brandValue = decodeURIComponent(brand);
442
443
  let dropdownOptions = _$w('#dropdownBrand').options;
443
444
  console.log("brand dropdown options:", dropdownOptions);
444
- const optionsFromCMS=await wixData.query("Brands").find();
445
+ const optionsFromCMS=await wixData.query(COLLECTIONS.BRANDS).find();
445
446
  if(dropdownOptions.length!==optionsFromCMS.items.length+1){
446
447
  fixDropdownOptions('#dropdownBrand',optionsFromCMS, _$w);
447
448
  }
@@ -495,7 +496,7 @@ async function updateMapMarkers(_$w){
495
496
  }
496
497
 
497
498
  async function handleBrandDropdown(_$w){
498
- const brands=await wixData.query("Brands").find();
499
+ const brands=await wixData.query(COLLECTIONS.BRANDS).find();
499
500
  if(brands.items.length>1){
500
501
  console.log("showing brand dropdown");
501
502
  _$w('#dropdownBrand').show();
@@ -11,7 +11,7 @@ const {
11
11
  _$w('#datasetJobsItem').onReady(async () => {
12
12
 
13
13
  const item = await _$w('#datasetJobsItem').getCurrentItem();
14
- await handleReferFriendButton(_$w,item);
14
+ handleReferFriendButton(_$w,item);
15
15
 
16
16
  _$w('#companyDescriptionText').text = htmlToText(item.jobDescription.companyDescription.text);
17
17
  _$w('#responsibilitiesText').text = htmlToText(item.jobDescription.jobDescription.text);