sr-npm 1.7.165 → 1.7.167
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 +18 -12
- package/package.json +1 -1
package/backend/data.js
CHANGED
|
@@ -31,14 +31,22 @@ async function saveJobsDataToCMS() {
|
|
|
31
31
|
const jobsData = positions.content.map(position => {
|
|
32
32
|
const basicJob = {
|
|
33
33
|
_id: position.id,
|
|
34
|
-
title: position.title,
|
|
35
|
-
department: position.department.label,
|
|
36
|
-
cityText: normalizeCityName(position.location.city),
|
|
37
|
-
location: position.location,
|
|
38
|
-
country: position.location.country,
|
|
39
|
-
remote: position.location.remote,
|
|
40
|
-
language: position.language.label,
|
|
41
|
-
postingStatus: position.postingStatus,
|
|
34
|
+
// title: position.title,
|
|
35
|
+
// department: position.department.label,
|
|
36
|
+
// cityText: normalizeCityName(position.location.city),
|
|
37
|
+
// location: position.location,
|
|
38
|
+
// country: position.location.country,
|
|
39
|
+
// remote: position.location.remote,
|
|
40
|
+
// language: position.language.label,
|
|
41
|
+
// postingStatus: position.postingStatus,
|
|
42
|
+
title: position.title || '',
|
|
43
|
+
department: position.department?.label || '',
|
|
44
|
+
cityText: normalizeCityName(position.location?.city),
|
|
45
|
+
location: position.location || {},
|
|
46
|
+
country: position.location?.country || '',
|
|
47
|
+
remote: position.location?.remote || false,
|
|
48
|
+
language: position.language?.label || '',
|
|
49
|
+
postingStatus: position.postingStatus || '',
|
|
42
50
|
jobDescription: null, // Will be filled later
|
|
43
51
|
};
|
|
44
52
|
return basicJob;
|
|
@@ -308,10 +316,8 @@ async function createCollections() {
|
|
|
308
316
|
|
|
309
317
|
async function aggregateJobs() {
|
|
310
318
|
console.log("Aggregating jobs");
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
aggregateJobsByFieldToCMS({ field: JOBS_COLLECTION_FIELDS.DEPARTMENT, collection: COLLECTIONS.AMOUNT_OF_JOBS_PER_DEPARTMENT })
|
|
314
|
-
]);
|
|
319
|
+
await aggregateJobsByFieldToCMS({ field: JOBS_COLLECTION_FIELDS.CITY_TEXT, collection: COLLECTIONS.CITIES });
|
|
320
|
+
await aggregateJobsByFieldToCMS({ field: JOBS_COLLECTION_FIELDS.DEPARTMENT, collection: COLLECTIONS.AMOUNT_OF_JOBS_PER_DEPARTMENT });
|
|
315
321
|
console.log("finished aggregating jobs");
|
|
316
322
|
}
|
|
317
323
|
|