sr-npm 1.7.582 → 1.7.584

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.
@@ -38,6 +38,7 @@ const CUSTOM_VALUES_COLLECTION_FIELDS = {
38
38
  TITLE: 'title',
39
39
  CUSTOM_FIELD: 'customField',
40
40
  MULTI_REF_JOBS_CUSTOM_VALUES: 'multiRefJobsCustomValues',
41
+ TOTAL_JOBS: 'totalJobs',
41
42
  }
42
43
  const CUSTOM_FIELDS_COLLECTION_FIELDS = {
43
44
  TITLE: 'title',
@@ -103,6 +104,7 @@ const COLLECTIONS_FIELDS = {
103
104
  CUSTOM_VALUES: [
104
105
  {key:'title', type: 'TEXT'},
105
106
  {key:'customField', type: 'REFERENCE', typeMetadata: { reference: { referencedCollectionId: COLLECTIONS.CUSTOM_FIELDS } } },
107
+ {key:'totalJobs', type: 'NUMBER'},
106
108
  {key:'multiRefJobsCustomValues', type: 'MULTI_REFERENCE', typeMetadata: { multiReference: { referencedCollectionId: COLLECTIONS.JOBS,referencingFieldKey:CUSTOM_VALUES_COLLECTION_FIELDS.MULTI_REF_JOBS_CUSTOM_VALUES,referencingDisplayName:CUSTOM_VALUES_COLLECTION_FIELDS.MULTI_REF_JOBS_CUSTOM_VALUES } } },
107
109
  ],
108
110
  CUSTOM_FIELDS: [
package/backend/data.js CHANGED
@@ -198,6 +198,7 @@ async function populateCustomValuesCollection(customFieldsValues) {
198
198
  _id: valueId,
199
199
  title: valuesMap[valueId],
200
200
  customField: fieldId,
201
+ totalJobs:customValuesToJobs[valueId].length,
201
202
  })
202
203
  }
203
204
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sr-npm",
3
- "version": "1.7.582",
3
+ "version": "1.7.584",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -90,6 +90,7 @@ async function loadJobs(_$w) {
90
90
  }));
91
91
  optionsByFieldId.set(fieldId, originalOptions);
92
92
  const counter={}
93
+ console.log("fieldValues: ",fieldValues)
93
94
  const all_results=await wixData.queryReferenced(COLLECTIONS.CUSTOM_VALUES, fieldValues, CUSTOM_VALUES_COLLECTION_FIELDS.MULTI_REF_JOBS_CUSTOM_VALUES)
94
95
  console.log("all_results@@@@@: ",all_results)
95
96
  console.log("all_results@@@@@: ",all_results)