sr-npm 1.7.210 → 1.7.212
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 +8 -16
- package/package.json +1 -1
package/backend/data.js
CHANGED
|
@@ -319,18 +319,14 @@ async function aggregateJobs() {
|
|
|
319
319
|
|
|
320
320
|
async function referenceJobs() {
|
|
321
321
|
console.log("Reference jobs");
|
|
322
|
-
await
|
|
323
|
-
|
|
324
|
-
referenceJobsToField({ referenceField: JOBS_COLLECTION_FIELDS.CITY, sourceCollection: COLLECTIONS.CITIES, jobField: JOBS_COLLECTION_FIELDS.CITY_TEXT }),
|
|
325
|
-
]);
|
|
322
|
+
await referenceJobsToField({ referenceField: JOBS_COLLECTION_FIELDS.DEPARTMENT_REF, sourceCollection: COLLECTIONS.AMOUNT_OF_JOBS_PER_DEPARTMENT, jobField: JOBS_COLLECTION_FIELDS.DEPARTMENT });
|
|
323
|
+
await referenceJobsToField({ referenceField: JOBS_COLLECTION_FIELDS.CITY, sourceCollection: COLLECTIONS.CITIES, jobField: JOBS_COLLECTION_FIELDS.CITY_TEXT });
|
|
326
324
|
console.log("finished referencing jobs");
|
|
327
325
|
}
|
|
328
326
|
|
|
329
327
|
async function syncJobsFast() {
|
|
330
328
|
console.log("Syncing jobs fast");
|
|
331
|
-
console.log("Creating collections");
|
|
332
329
|
await createCollections();
|
|
333
|
-
console.log("created collections successfully");
|
|
334
330
|
await clearCollections();
|
|
335
331
|
console.log("saving jobs data to CMS");
|
|
336
332
|
await saveJobsDataToCMS();
|
|
@@ -338,22 +334,18 @@ async function syncJobsFast() {
|
|
|
338
334
|
console.log("saving jobs descriptions and location apply url to CMS");
|
|
339
335
|
await saveJobsDescriptionsAndLocationApplyUrlToCMS();
|
|
340
336
|
console.log("saved jobs descriptions and location apply url to CMS successfully");
|
|
341
|
-
console.log("aggregating jobs");
|
|
342
337
|
await aggregateJobs();
|
|
343
|
-
console.log("aggregated jobs successfully");
|
|
344
|
-
console.log("referencing jobs");
|
|
345
338
|
await referenceJobs();
|
|
346
|
-
console.log("referenced jobs successfully");
|
|
347
339
|
console.log("syncing jobs fast finished successfully");
|
|
348
340
|
}
|
|
349
341
|
|
|
350
342
|
async function clearCollections() {
|
|
351
|
-
console.log("clearing
|
|
352
|
-
await
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
343
|
+
console.log("clearing collections");
|
|
344
|
+
await Promise.all([
|
|
345
|
+
wixData.truncate(COLLECTIONS.CITIES),
|
|
346
|
+
wixData.truncate(COLLECTIONS.AMOUNT_OF_JOBS_PER_DEPARTMENT),
|
|
347
|
+
wixData.truncate(COLLECTIONS.JOBS)
|
|
348
|
+
]);
|
|
357
349
|
console.log("cleared collections successfully");
|
|
358
350
|
}
|
|
359
351
|
|