sr-npm 1.7.801 → 1.7.802

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.
@@ -1,4 +1,4 @@
1
- const { COLLECTIONS } = require('./collectionConsts');
1
+ const { COLLECTIONS,JOBS_COLLECTION_FIELDS } = require('./collectionConsts');
2
2
  const { items: wixData } = require('@wix/data');
3
3
 
4
4
 
@@ -18,7 +18,12 @@ async function getPositionsByField(field, value) {
18
18
  .then(result => result.items);
19
19
  }
20
20
 
21
- module.exports = {
22
- getAllPositions,
23
- getPositionsByField,
24
- };
21
+ async function getPositionWithMultiRefField(jobId)
22
+ {
23
+ return wixData
24
+ .queryReferenced(COLLECTIONS.JOBS,jobId,JOBS_COLLECTION_FIELDS.MULTI_REF_JOBS_CUSTOM_VALUES)
25
+ .find()
26
+ .then(result => result.items[0]);
27
+ }
28
+
29
+ module.exports = { getAllPositions, getPositionsByField, getPositionWithMultiRefField };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sr-npm",
3
- "version": "1.7.801",
3
+ "version": "1.7.802",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1,4 +1,5 @@
1
1
  const { query } = require("wix-location-frontend");
2
+ const { getPositionWithMultiRefField } = require('../backend/queries');
2
3
  const {
3
4
  htmlToText,
4
5
  appendQueryParams
@@ -17,6 +18,8 @@ const {
17
18
 
18
19
  const item = await _$w('#datasetJobsItem').getCurrentItem();
19
20
  console.log("item@@$@$@$#$@: ", item);
21
+ const multiRefField=await getPositionWithMultiRefField(item._id);
22
+ console.log("multiRefField@@$@$@$#$@: ", multiRefField);
20
23
  handleReferFriendButton(_$w,item);
21
24
 
22
25
  handleApplyButton(_$w,item);