sr-npm 1.7.211 → 1.7.213

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 +18 -13
  2. package/package.json +1 -1
package/backend/data.js CHANGED
@@ -33,7 +33,18 @@ async function saveJobsDataToCMS() {
33
33
  title: position.title || '',
34
34
  department: position.department?.label || 'Other',
35
35
  cityText: normalizeCityName(position.location?.city),
36
- location: position.location || {},
36
+ location: position.location && Object.keys(position.location).length > 0
37
+ ? position.location
38
+ : {
39
+ countryCode: "",
40
+ country: "",
41
+ city: "",
42
+ postalCode: "",
43
+ address: "",
44
+ manual: false,
45
+ remote: false,
46
+ regionCode: ""
47
+ },
37
48
  country: position.location?.country || '',
38
49
  remote: position.location?.remote || false,
39
50
  language: position.language?.label || '',
@@ -326,9 +337,7 @@ async function referenceJobs() {
326
337
 
327
338
  async function syncJobsFast() {
328
339
  console.log("Syncing jobs fast");
329
- console.log("Creating collections");
330
340
  await createCollections();
331
- console.log("created collections successfully");
332
341
  await clearCollections();
333
342
  console.log("saving jobs data to CMS");
334
343
  await saveJobsDataToCMS();
@@ -336,22 +345,18 @@ async function syncJobsFast() {
336
345
  console.log("saving jobs descriptions and location apply url to CMS");
337
346
  await saveJobsDescriptionsAndLocationApplyUrlToCMS();
338
347
  console.log("saved jobs descriptions and location apply url to CMS successfully");
339
- console.log("aggregating jobs");
340
348
  await aggregateJobs();
341
- console.log("aggregated jobs successfully");
342
- console.log("referencing jobs");
343
349
  await referenceJobs();
344
- console.log("referenced jobs successfully");
345
350
  console.log("syncing jobs fast finished successfully");
346
351
  }
347
352
 
348
353
  async function clearCollections() {
349
- console.log("clearing cities collection");
350
- await wixData.truncate(COLLECTIONS.CITIES);
351
- console.log("clearing amount of jobs per department collection");
352
- await wixData.truncate(COLLECTIONS.AMOUNT_OF_JOBS_PER_DEPARTMENT);
353
- console.log("clearing jobs collection");
354
- await wixData.truncate(COLLECTIONS.JOBS);
354
+ console.log("clearing collections");
355
+ await Promise.all([
356
+ wixData.truncate(COLLECTIONS.CITIES),
357
+ wixData.truncate(COLLECTIONS.AMOUNT_OF_JOBS_PER_DEPARTMENT),
358
+ wixData.truncate(COLLECTIONS.JOBS)
359
+ ]);
355
360
  console.log("cleared collections successfully");
356
361
  }
357
362
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sr-npm",
3
- "version": "1.7.211",
3
+ "version": "1.7.213",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {