sr-npm 1.7.544 → 1.7.546
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/collectionConsts.js +2 -2
- package/backend/data.js +3 -3
- package/package.json +1 -1
|
@@ -73,7 +73,7 @@ const COLLECTIONS_FIELDS = {
|
|
|
73
73
|
{key:'language', type: 'TEXT'},
|
|
74
74
|
{key:'remote', type: 'BOOLEAN'},
|
|
75
75
|
{key:'jobDescription', type: 'OBJECT'},
|
|
76
|
-
{key:'multiRefJobsCustomValues', type: 'MULTI_REFERENCE', typeMetadata: { multiReference: { referencedCollectionId: COLLECTIONS.CUSTOM_VALUES,referencingFieldKey:
|
|
76
|
+
{key:'multiRefJobsCustomValues', type: 'MULTI_REFERENCE', typeMetadata: { multiReference: { referencedCollectionId: COLLECTIONS.CUSTOM_VALUES,referencingFieldKey:JOBS_COLLECTION_FIELDS.MULTI_REF_JOBS_CUSTOM_VALUES,referencingDisplayName:JOBS_COLLECTION_FIELDS.MULTI_REF_JOBS_CUSTOM_VALUES } } },
|
|
77
77
|
{key:'cityText', type: 'TEXT'},
|
|
78
78
|
{key:'applyLink', type: 'URL'},
|
|
79
79
|
{key:'referFriendLink', type: 'URL'},
|
|
@@ -97,7 +97,7 @@ const COLLECTIONS_FIELDS = {
|
|
|
97
97
|
CUSTOM_VALUES: [
|
|
98
98
|
{key:'title', type: 'TEXT'},
|
|
99
99
|
{key:'customField', type: 'REFERENCE', typeMetadata: { reference: { referencedCollectionId: COLLECTIONS.CUSTOM_FIELDS } } },
|
|
100
|
-
{key:'multiRefJobsCustomValues', type: 'MULTI_REFERENCE', typeMetadata: { multiReference: { referencedCollectionId: COLLECTIONS.JOBS,referencingFieldKey:
|
|
100
|
+
{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 } } },
|
|
101
101
|
],
|
|
102
102
|
CUSTOM_FIELDS: [
|
|
103
103
|
{key:'title', type: 'TEXT'},
|
package/backend/data.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const { items: wixData } = require('@wix/data');
|
|
2
2
|
const { fetchPositionsFromSRAPI, fetchJobDescription } = require('./fetchPositionsFromSRAPI');
|
|
3
3
|
const { createCollectionIfMissing } = require('@hisense-staging/velo-npm/backend');
|
|
4
|
-
const { COLLECTIONS, COLLECTIONS_FIELDS,JOBS_COLLECTION_FIELDS,TEMPLATE_TYPE,TOKEN_NAME,CUSTOM_VALUES_COLLECTION_FIELDS
|
|
4
|
+
const { COLLECTIONS, COLLECTIONS_FIELDS,JOBS_COLLECTION_FIELDS,TEMPLATE_TYPE,TOKEN_NAME,CUSTOM_VALUES_COLLECTION_FIELDS } = require('./collectionConsts');
|
|
5
5
|
const { chunkedBulkOperation, countJobsPerGivenField, fillCityLocationAndLocationAddress ,prepareToSaveArray,normalizeString} = require('./utils');
|
|
6
6
|
const { getAllPositions } = require('./queries');
|
|
7
7
|
const { retrieveSecretVal, getTokenFromCMS } = require('./secretsData');
|
|
@@ -55,8 +55,8 @@ function validateSingleDesiredBrand(desiredBrand) {
|
|
|
55
55
|
function getCustomFieldsAndValuesFromPosition(position,customFieldsLabels,customFieldsValues,jobToCustomValues) {
|
|
56
56
|
const customFieldsArray = Array.isArray(position?.customField) ? position.customField : [];
|
|
57
57
|
for (const field of customFieldsArray) {
|
|
58
|
-
if(field.fieldLabel==="Country" || field.fieldLabel==="Department") continue; //country and department are not custom fields, they are already in the job object
|
|
59
|
-
const label = field.fieldLabel==="Brands" ? "brand" : field.fieldLabel
|
|
58
|
+
if(field.fieldLabel==="Country" || field.fieldLabel==="Department" || field.fieldLabel==="Brands") continue; //country and department are not custom fields, they are already in the job object
|
|
59
|
+
//const label = field.fieldLabel==="Brands" ? "brand" : field.fieldLabel
|
|
60
60
|
const fieldId=field.fieldId
|
|
61
61
|
const fieldLabel = normalizeString(label);
|
|
62
62
|
const valueId=field.valueId
|