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.
Files changed (2) hide show
  1. package/backend/data.js +8 -9
  2. 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
- await clearCollections();
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
- console.log("jobsData inside syncJobsFast: ",jobsData);
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
- throw new Error("test");
425
- console.log("status inside syncJobsFast: ",status);
423
+ throw new Error("test");
426
424
  if(status.success){
427
- await wixData.truncate(COLLECTIONS.JOBS)
425
+
426
+ await clearCollections();
428
427
  const updatedJobs=status.updatedJobs;
429
- console.log("updatedJobs inside syncJobsFast: ",updatedJobs);
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
  ]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sr-npm",
3
- "version": "1.7.1322",
3
+ "version": "1.7.1324",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {