sr-npm 1.7.50 → 1.7.52
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 -10
- package/package.json +1 -1
package/backend/data.js
CHANGED
|
@@ -138,18 +138,11 @@ async function saveJobsDescriptionsAndLocationToCMS() {
|
|
|
138
138
|
|
|
139
139
|
|
|
140
140
|
async function iterateOverAllJobs(results, field, jobsPerField, cityLocations) {
|
|
141
|
-
let page = 1;
|
|
142
|
-
do {
|
|
143
|
-
console.log(`Page ${page}: ${results.length} jobs.`);
|
|
144
141
|
countJobsPerGivenField(results, field, jobsPerField);
|
|
145
142
|
if (field === 'cityText') {
|
|
146
143
|
fillCityLocation(results, cityLocations);
|
|
147
144
|
}
|
|
148
|
-
|
|
149
|
-
results = await results.next();
|
|
150
|
-
page++;
|
|
151
|
-
}
|
|
152
|
-
} while (results.hasNext());
|
|
145
|
+
|
|
153
146
|
}
|
|
154
147
|
|
|
155
148
|
async function aggregateJobsByFieldToCMS({ field, collection }) {
|
|
@@ -158,8 +151,11 @@ async function aggregateJobsByFieldToCMS({ field, collection }) {
|
|
|
158
151
|
const cityLocations = {};
|
|
159
152
|
let results = await getAllPositions();
|
|
160
153
|
await iterateOverAllJobs(results, field, jobsPerField, cityLocations);
|
|
161
|
-
|
|
154
|
+
const toSave = [];
|
|
155
|
+
console.log('jobsPerField is@@@@@@@@ ', jobsPerField);
|
|
156
|
+
console.log('cityLocations is@@@@@@@@ ', cityLocations);
|
|
162
157
|
prepateToSaveArray(jobsPerField, cityLocations, field, toSave);
|
|
158
|
+
console.log('toSave is@@@@@@@@ ', toSave);
|
|
163
159
|
if (toSave.length === 0) {
|
|
164
160
|
console.log('No jobs found.');
|
|
165
161
|
return { success: true, message: 'No jobs to save.' };
|
|
@@ -200,7 +196,7 @@ async function referenceJobsToField({ referenceField, sourceCollection, jobField
|
|
|
200
196
|
// Fetch all jobs
|
|
201
197
|
let jobsResults = await getAllPositions();
|
|
202
198
|
let jobsToUpdate = [];
|
|
203
|
-
console.log('jobsResults', jobsResults);
|
|
199
|
+
console.log('jobsResults@@@@@@@@ ', jobsResults);
|
|
204
200
|
|
|
205
201
|
for (const job of jobsResults) {
|
|
206
202
|
const refId = sourceMap[job[jobField]];
|