sr-npm 1.7.503 → 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 +7 -7
- package/package.json +1 -1
- package/pages/careersPage.js +3 -2
- package/pages/positionPage.js +1 -1
package/backend/data.js
CHANGED
|
@@ -38,17 +38,16 @@ async function filterBasedOnBrand(positions) {
|
|
|
38
38
|
return brand === desiredBrand;
|
|
39
39
|
});
|
|
40
40
|
} catch (error) {
|
|
41
|
-
if(error.message
|
|
42
|
-
|
|
41
|
+
if(error.message==="[getTokenFromCMS], No desiredBrand found")
|
|
42
|
+
{
|
|
43
|
+
console.log("no desiredBrand found, fetching all positions")
|
|
44
|
+
return positions.content;
|
|
43
45
|
}
|
|
44
|
-
|
|
45
|
-
return positions.content;
|
|
46
|
+
throw error;
|
|
46
47
|
}
|
|
47
48
|
}
|
|
48
49
|
|
|
49
50
|
function validateSingleDesiredBrand(desiredBrand) {
|
|
50
|
-
console.log("desiredBrand is: ", desiredBrand);
|
|
51
|
-
console.log("typeof desiredBrand is: ", typeof desiredBrand);
|
|
52
51
|
if(typeof desiredBrand !== 'string' || desiredBrand.includes("[") || desiredBrand.includes("]") || desiredBrand.includes(",")){
|
|
53
52
|
throw new Error("Desired brand must be a single brand");
|
|
54
53
|
}
|
|
@@ -374,7 +373,8 @@ async function clearCollections() {
|
|
|
374
373
|
await Promise.all([
|
|
375
374
|
wixData.truncate(COLLECTIONS.CITIES),
|
|
376
375
|
wixData.truncate(COLLECTIONS.AMOUNT_OF_JOBS_PER_DEPARTMENT),
|
|
377
|
-
wixData.truncate(COLLECTIONS.JOBS)
|
|
376
|
+
wixData.truncate(COLLECTIONS.JOBS),
|
|
377
|
+
wixData.truncate(COLLECTIONS.BRANDS)
|
|
378
378
|
]);
|
|
379
379
|
console.log("cleared collections successfully");
|
|
380
380
|
}
|
package/package.json
CHANGED
package/pages/careersPage.js
CHANGED
|
@@ -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(
|
|
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(
|
|
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();
|
package/pages/positionPage.js
CHANGED
|
@@ -11,7 +11,7 @@ const {
|
|
|
11
11
|
_$w('#datasetJobsItem').onReady(async () => {
|
|
12
12
|
|
|
13
13
|
const item = await _$w('#datasetJobsItem').getCurrentItem();
|
|
14
|
-
|
|
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);
|