sr-npm 1.7.505 → 1.7.507

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
@@ -373,8 +373,7 @@ 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),
377
- wixData.truncate(COLLECTIONS.BRANDS)
376
+ wixData.truncate(COLLECTIONS.JOBS)
378
377
  ]);
379
378
  console.log("cleared collections successfully");
380
379
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sr-npm",
3
- "version": "1.7.505",
3
+ "version": "1.7.507",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,10 +1,12 @@
1
1
  const {
2
2
  htmlToText
3
3
  } = require('../public/utils');
4
-
4
+ const { wixLocationFrontend } = require("wix-location-frontend");
5
+
5
6
  async function positionPageOnReady(_$w) {
6
7
 
7
8
  await bind(_$w);
9
+
8
10
  }
9
11
 
10
12
  async function bind(_$w) {
@@ -12,6 +14,7 @@ const {
12
14
 
13
15
  const item = await _$w('#datasetJobsItem').getCurrentItem();
14
16
  handleReferFriendButton(_$w,item);
17
+ _$w('#applyButton').onClick(()=>handleApplyButton(_$w,item));
15
18
 
16
19
  _$w('#companyDescriptionText').text = htmlToText(item.jobDescription.companyDescription.text);
17
20
  _$w('#responsibilitiesText').text = htmlToText(item.jobDescription.jobDescription.text);
@@ -33,7 +36,24 @@ const {
33
36
  _$w('#referFriendButton').hide();
34
37
  }
35
38
  }
36
-
39
+
40
+ function handleApplyButton(_$w,item) {
41
+ console.log("item is: ", item);
42
+ console.log(wixLocationFrontend.query);
43
+ const applyLinkWithQueryParams=appendQueryParams(item.applyLink);
44
+ console.log("applyLinkWithQueryParams is: ", applyLinkWithQueryParams);
45
+
46
+ //wixLocationFrontend.to(item.applyLink);
47
+ }
48
+
49
+ function appendQueryParams(url){
50
+ const urlObj=new URL(url);
51
+ Object.entries(queryParams).forEach(([key,value])=>{
52
+ urlObj.searchParams.set(key,value);
53
+ });
54
+ console.log("urlObj is: ", urlObj);
55
+ return urlObj.toString();
56
+ }
37
57
  module.exports = {
38
58
  positionPageOnReady,
39
59
  };