sr-npm 1.7.519 → 1.7.520
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 +6 -5
- package/package.json +1 -1
package/backend/data.js
CHANGED
|
@@ -52,14 +52,16 @@ function validateSingleDesiredBrand(desiredBrand) {
|
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
function
|
|
55
|
+
function addCustomFields(basicJob, position) {
|
|
56
56
|
const customFieldsArray = Array.isArray(position?.customField) ? position.customField : [];
|
|
57
|
+
const customFields = {};
|
|
57
58
|
for (const field of customFieldsArray) {
|
|
58
59
|
const label = field.fieldLabel;
|
|
59
60
|
const key = normalizeString(label);
|
|
60
61
|
const value = field.valueLabel
|
|
61
|
-
|
|
62
|
+
customFields[key] = value;
|
|
62
63
|
}
|
|
64
|
+
return { ...basicJob, customFields };
|
|
63
65
|
}
|
|
64
66
|
|
|
65
67
|
async function saveJobsDataToCMS() {
|
|
@@ -87,11 +89,10 @@ async function saveJobsDataToCMS() {
|
|
|
87
89
|
country: position.location?.country || '',
|
|
88
90
|
remote: position.location?.remote || false,
|
|
89
91
|
language: position.language?.label || '',
|
|
90
|
-
|
|
92
|
+
// brand: getBrand(position.customField),
|
|
91
93
|
jobDescription: null, // Will be filled later
|
|
92
94
|
};
|
|
93
|
-
|
|
94
|
-
console.log("basicJob: ", basicJob);
|
|
95
|
+
basicJob=addCustomFields(basicJob,position)
|
|
95
96
|
return basicJob;
|
|
96
97
|
});
|
|
97
98
|
|