sr-npm 1.7.1322 → 1.7.1324
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 -9
- package/package.json +1 -1
package/backend/data.js
CHANGED
|
@@ -218,7 +218,6 @@ async function populateCustomValuesCollection(customFieldsValues) {
|
|
|
218
218
|
|
|
219
219
|
async function retrieveJobsDescriptionsAndLocationApplyUrlReferences(jobsWithNoDescriptions) {
|
|
220
220
|
console.log('🚀 Starting job descriptions update process for ALL jobs');
|
|
221
|
-
console.log("jobsWithNoDescriptions: ",jobsWithNoDescriptions);
|
|
222
221
|
|
|
223
222
|
try {
|
|
224
223
|
|
|
@@ -238,7 +237,6 @@ async function retrieveJobsDescriptionsAndLocationApplyUrlReferences(jobsWithNoD
|
|
|
238
237
|
};
|
|
239
238
|
return updatedJob;
|
|
240
239
|
}))
|
|
241
|
-
console.log("jobsWithDescriptions: after map ",jobsWithDescriptions);
|
|
242
240
|
return {success: true, updatedJobs: jobsWithDescriptions};
|
|
243
241
|
|
|
244
242
|
} catch (error) {
|
|
@@ -410,25 +408,25 @@ async function syncJobsFast() {
|
|
|
410
408
|
try{
|
|
411
409
|
console.log("Syncing jobs fast");
|
|
412
410
|
await createCollections();
|
|
413
|
-
|
|
411
|
+
|
|
414
412
|
await fillSecretManagerMirror();
|
|
415
413
|
|
|
416
414
|
console.log("retrieving jobs data from SR API");
|
|
415
|
+
|
|
417
416
|
const jobsData = await retrieveJobsData();
|
|
418
|
-
|
|
417
|
+
|
|
419
418
|
console.log("retrieved jobs data from SR API successfully");
|
|
420
419
|
|
|
421
420
|
console.log("retrieving jobs descriptions and location apply url from SR API");
|
|
422
421
|
|
|
423
422
|
const status=await retrieveJobsDescriptionsAndLocationApplyUrlReferences(jobsData);
|
|
424
|
-
|
|
425
|
-
console.log("status inside syncJobsFast: ",status);
|
|
423
|
+
throw new Error("test");
|
|
426
424
|
if(status.success){
|
|
427
|
-
|
|
425
|
+
|
|
426
|
+
await clearCollections();
|
|
428
427
|
const updatedJobs=status.updatedJobs;
|
|
429
|
-
console.log("
|
|
428
|
+
console.log("saving jobs to CMS");
|
|
430
429
|
await saveJobsToCMS(updatedJobs);
|
|
431
|
-
console.log("saved jobs to CMS successfully");
|
|
432
430
|
|
|
433
431
|
if (siteconfig.customFields==="true") {
|
|
434
432
|
await insertJobsReferencesToCustomValuesCollection();
|
|
@@ -498,6 +496,7 @@ async function clearCollections() {
|
|
|
498
496
|
wixData.truncate(COLLECTIONS.CITIES),
|
|
499
497
|
wixData.truncate(COLLECTIONS.AMOUNT_OF_JOBS_PER_DEPARTMENT),
|
|
500
498
|
wixData.truncate(COLLECTIONS.BRANDS),
|
|
499
|
+
wixData.truncate(COLLECTIONS.JOBS),
|
|
501
500
|
siteconfig.customFields==="true" ? wixData.truncate(COLLECTIONS.CUSTOM_VALUES) : null,
|
|
502
501
|
siteconfig.customFields==="true" ? wixData.truncate(COLLECTIONS.CUSTOM_FIELDS) : null,
|
|
503
502
|
]);
|