sr-npm 1.7.511 → 1.7.513

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
@@ -357,6 +357,7 @@ async function syncJobsFast() {
357
357
  await createCollections();
358
358
  await clearCollections();
359
359
  await fillSecretManagerMirror();
360
+
360
361
  console.log("saving jobs data to CMS");
361
362
  await saveJobsDataToCMS();
362
363
  console.log("saved jobs data to CMS successfully");
@@ -373,7 +374,8 @@ async function clearCollections() {
373
374
  await Promise.all([
374
375
  wixData.truncate(COLLECTIONS.CITIES),
375
376
  wixData.truncate(COLLECTIONS.AMOUNT_OF_JOBS_PER_DEPARTMENT),
376
- wixData.truncate(COLLECTIONS.JOBS)
377
+ wixData.truncate(COLLECTIONS.JOBS),
378
+ wixData.truncate(COLLECTIONS.BRANDS)
377
379
  ]);
378
380
  console.log("cleared collections successfully");
379
381
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sr-npm",
3
- "version": "1.7.511",
3
+ "version": "1.7.513",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,7 +1,9 @@
1
+ const { query } = require("wix-location-frontend");
1
2
  const {
2
- htmlToText
3
+ htmlToText,
4
+ appendQueryParams
3
5
  } = require('../public/utils');
4
- const { query,queryParams,to } = require("wix-location-frontend");
6
+
5
7
 
6
8
  async function positionPageOnReady(_$w) {
7
9
 
@@ -16,12 +18,7 @@ const {
16
18
 
17
19
  handleReferFriendButton(_$w,item);
18
20
 
19
- _$w('#applyButton').target="_blank";//so it can open in new tab
20
- // _$w('#applyButton').onClick(()=>handleApplyButton(_$w,item));
21
- const url=appendQueryParams(item.applyLink);
22
- console.log("url is: ", url);
23
- _$w('#applyButton').link=url;
24
- console.log("applyButton.target is: ", _$w('#applyButton').target);
21
+ handleApplyButton(_$w,item);
25
22
 
26
23
  _$w('#companyDescriptionText').text = htmlToText(item.jobDescription.companyDescription.text);
27
24
  _$w('#responsibilitiesText').text = htmlToText(item.jobDescription.jobDescription.text);
@@ -45,18 +42,11 @@ const {
45
42
  }
46
43
 
47
44
  function handleApplyButton(_$w,item) {
48
- const applyLinkWithQueryParams=appendQueryParams(item.applyLink);
49
- console.log("applyLinkWithQueryParams is: ", applyLinkWithQueryParams);
50
- to(applyLinkWithQueryParams);
45
+ _$w('#applyButton').target="_blank";//so it can open in new tab
46
+ const url=appendQueryParams(item.applyLink,query);
47
+ _$w('#applyButton').link=url; //so it can be clicked
51
48
  }
52
49
 
53
- function appendQueryParams(url){
54
- const urlObj=new URL(url);
55
- Object.entries(query).forEach(([key,value])=>{
56
- urlObj.searchParams.set(key,value);
57
- });
58
- return urlObj.toString();
59
- }
60
50
  module.exports = {
61
51
  positionPageOnReady,
62
52
  };
package/public/utils.js CHANGED
@@ -39,7 +39,16 @@ function filterBrokenMarkers(items) {
39
39
  }
40
40
 
41
41
 
42
+ function appendQueryParams(url,query){
43
+ const urlObj=new URL(url);
44
+ Object.entries(query).forEach(([key,value])=>{
45
+ urlObj.searchParams.set(key,value);
46
+ });
47
+ return urlObj.toString();
48
+ }
49
+
42
50
  module.exports = {
43
51
  htmlToText,
44
- filterBrokenMarkers
52
+ filterBrokenMarkers,
53
+ appendQueryParams
45
54
  };