sr-npm 1.7.904 → 1.7.906

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.904",
3
+ "version": "1.7.906",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -181,6 +181,7 @@ async function primarySearch(_$w,query,alljobs) {
181
181
  async function getValueFromValueId(valueId) {
182
182
  const result=await getAllRecords(COLLECTIONS.CUSTOM_VALUES);
183
183
  console.log("result: ",result);
184
+ console.log("valueId: ",valueId);
184
185
  return result.find(value=>value._id===valueId);
185
186
 
186
187
  }
@@ -51,7 +51,7 @@ async function getCategoryValueId(customValues) {
51
51
  }
52
52
  if(_$w('#relatedJobsRepNoDepartment')) // when there is no department, we filter based on category
53
53
  {
54
- const relatedJobs=await getRelatedJobs(categoryValueId,item._id,5);
54
+ const relatedJobs = await getRelatedJobs({ categoryValueId, itemId: item._id ,limit:5});
55
55
  _$w('#relatedJobsRepNoDepartment').onItemReady(($item, itemData) => {
56
56
  $item('#relatedJobTitle').text = itemData.title;
57
57
  $item('#relatedJobLocation').text = itemData.location.fullLocation;
@@ -99,7 +99,9 @@ async function getCategoryValueId(customValues) {
99
99
  }
100
100
  }
101
101
 
102
- async function getRelatedJobs(categoryValueId,itemId,limit=1000) {
102
+ async function getRelatedJobs({ categoryValueId, itemId, limit = 1000 }) {
103
+
104
+
103
105
  const relatedJobs=await wixData.query(COLLECTIONS.JOBS).include(JOBS_COLLECTION_FIELDS.MULTI_REF_JOBS_CUSTOM_VALUES).hasSome(JOBS_COLLECTION_FIELDS.MULTI_REF_JOBS_CUSTOM_VALUES,[categoryValueId]).ne("_id",itemId).limit(limit).find();
104
106
  return relatedJobs.items;
105
107
  }
@@ -14,7 +14,9 @@ async function supportTeasmPageOnReady(_$w) {
14
14
  async function handleRecentJobsSection(_$w) {
15
15
 
16
16
  const currentItem= _$w(supportTeamsPageIds.TEAM_SUPPORT_DYNAMIC_DATASET).getCurrentItem();
17
+ console.log("currentItem: ",currentItem);
17
18
  const valueId=supportTeamsPageIds.valueToValueIdMap[currentItem.title_fld]
19
+ console.log("valueId: ",valueId);
18
20
  const Value=await getValueFromValueId(valueId);
19
21
  console.log("Value: ",Value);
20
22
  const latestsJobs=await getLatestJobsByValue(Value);