sr-npm 1.7.570 → 1.7.571
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/data.js +10 -7
- package/package.json +1 -1
package/backend/data.js
CHANGED
|
@@ -62,6 +62,15 @@ function validateSingleDesiredBrand(desiredBrand) {
|
|
|
62
62
|
throw new Error("Desired brand must be a single brand");
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
+
function getEmploymentType(position,customFieldsValues) {
|
|
66
|
+
if (!customFieldsValues["employmentType"]) {
|
|
67
|
+
customFieldsValues["employmentType"] = {};
|
|
68
|
+
}
|
|
69
|
+
customFieldsValues["employmentType"][position.typeOfEmployment.id] = position.typeOfEmployment.label;
|
|
70
|
+
jobToCustomValues[position.id] ? jobToCustomValues[position.id].push(position.typeOfEmployment.id) : jobToCustomValues[position.id]=[position.typeOfEmployment.id]
|
|
71
|
+
customValuesToJobs[position.typeOfEmployment.id] ? customValuesToJobs[position.typeOfEmployment.id].push(position.id) : customValuesToJobs[position.typeOfEmployment.id]=[position.id]
|
|
72
|
+
}
|
|
73
|
+
|
|
65
74
|
function getCustomFieldsAndValuesFromPosition(position,customFieldsLabels,customFieldsValues) {
|
|
66
75
|
const customFieldsArray = Array.isArray(position?.customField) ? position.customField : [];
|
|
67
76
|
for (const field of customFieldsArray) {
|
|
@@ -80,13 +89,6 @@ function getCustomFieldsAndValuesFromPosition(position,customFieldsLabels,custom
|
|
|
80
89
|
jobToCustomValues[position.id] ? jobToCustomValues[position.id].push(valueId) : jobToCustomValues[position.id]=[valueId]
|
|
81
90
|
customValuesToJobs[valueId] ? customValuesToJobs[valueId].push(position.id) : customValuesToJobs[valueId]=[position.id]
|
|
82
91
|
}
|
|
83
|
-
|
|
84
|
-
if (!customFieldsValues["employmentType"]) {
|
|
85
|
-
customFieldsValues["employmentType"] = {};
|
|
86
|
-
}
|
|
87
|
-
customFieldsValues["employmentType"][position.typeOfEmployment.id] = position.typeOfEmployment.label;
|
|
88
|
-
|
|
89
|
-
|
|
90
92
|
}
|
|
91
93
|
async function saveJobsDataToCMS() {
|
|
92
94
|
const positions = await fetchPositionsFromSRAPI();
|
|
@@ -122,6 +124,7 @@ async function saveJobsDataToCMS() {
|
|
|
122
124
|
};
|
|
123
125
|
|
|
124
126
|
getCustomFieldsAndValuesFromPosition(position,customFieldsLabels,customFieldsValues);
|
|
127
|
+
getEmploymentType(position,customFieldsValues);
|
|
125
128
|
return basicJob;
|
|
126
129
|
});
|
|
127
130
|
if(siteconfig===undefined) {
|