sr-npm 1.7.776 → 1.7.778

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.776",
3
+ "version": "1.7.778",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -58,13 +58,13 @@ function groupValuesByField(values, refKey) {
58
58
  }
59
59
  }
60
60
 
61
- async function getLatestJobsByCategory(category) {
62
- console.log("category: ", category);
61
+ async function getLatestJobsByCategoryId(categoryId) {
62
+ console.log("categoryId: ", categoryId);
63
63
  const result=await getAllRecords(COLLECTIONS.CUSTOM_VALUES);
64
64
  console.log("result: ", result);
65
- const categoryValue=result.filter(value=>value.title.toLowerCase()===category.toLowerCase());
65
+ const categoryValue=result.filter(value=>value._id===categoryId);
66
66
  console.log("categoryValue: ", categoryValue);
67
-
67
+
68
68
 
69
69
  }
70
70
 
@@ -76,5 +76,5 @@ function groupValuesByField(values, refKey) {
76
76
  getFieldByTitle,
77
77
  getCorrectOption,
78
78
  getOptionIndexFromCheckBox,
79
- getLatestJobsByCategory
79
+ getLatestJobsByCategoryId
80
80
  }
@@ -1,10 +1,14 @@
1
- const { getLatestJobsByCategory } = require('./pagesUtils');
1
+ const { getLatestJobsByCategoryId } = require('./pagesUtils');
2
2
  const { location } = require("@wix/site-location");
3
3
  const RECENTLEY_ADDED_JOBS="#recentleyAddedJobs"
4
4
  const JOB_LOCATION="#jobLocation"
5
5
  const JOB_TITLE="#jobTitle"
6
6
  const TEAM_NAME="#teamName"
7
7
  const SEE_ALL_JOBS_TEXT="#seeAllJobsText"
8
+ const TEAM_SUPPORT_DYNAMIC_DATASET="#dynamicDataset"
9
+ const valueToCategoryIdMap={
10
+ "Human Resouces":"PeopleSupport"
11
+ }
8
12
 
9
13
  async function supportTeasmPageOnReady(_$w) {
10
14
 
@@ -27,9 +31,10 @@ async function bindRepeater(_$w) {
27
31
  await location.to(itemData["link-jobs-title"]);
28
32
  })
29
33
  });
30
- const teamName=_$w(TEAM_NAME).label.toLowerCase();
31
- console.log("teamName: ", teamName);
32
- const latestsJobs=await getLatestJobsByCategory(teamName);
34
+ let obj= _$w(TEAM_SUPPORT_DYNAMIC_DATASET).getCurrentItem();
35
+ console.log("obj: ", obj);
36
+ const categoryId=valueToCategoryIdMap[obj.title_fld]
37
+ const latestsJobs=await getLatestJobsByCategoryId(categoryId);
33
38
  console.log("latestsJobs: ", latestsJobs);
34
39
 
35
40
  // const teamName=_$w(TEAM_NAME).label.toLowerCase();