sr-npm 1.7.208 → 1.7.209
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 +11 -6
- package/package.json +1 -1
package/backend/data.js
CHANGED
|
@@ -335,12 +335,7 @@ async function syncJobsFast() {
|
|
|
335
335
|
console.log("Creating collections");
|
|
336
336
|
await createCollections();
|
|
337
337
|
console.log("created collections successfully");
|
|
338
|
-
|
|
339
|
-
await wixData.truncate(COLLECTIONS.CITIES);
|
|
340
|
-
console.log("truncating amount of jobs per department collection");
|
|
341
|
-
await wixData.truncate(COLLECTIONS.AMOUNT_OF_JOBS_PER_DEPARTMENT);
|
|
342
|
-
console.log("truncating jobs collection");
|
|
343
|
-
await wixData.truncate(COLLECTIONS.JOBS);
|
|
338
|
+
await clearCollections();
|
|
344
339
|
console.log("saving jobs data to CMS");
|
|
345
340
|
await saveJobsDataToCMS();
|
|
346
341
|
console.log("saved jobs data to CMS successfully");
|
|
@@ -356,6 +351,16 @@ async function syncJobsFast() {
|
|
|
356
351
|
console.log("syncing jobs fast finished successfully");
|
|
357
352
|
}
|
|
358
353
|
|
|
354
|
+
async function clearCollections() {
|
|
355
|
+
console.log("clearing cities collection");
|
|
356
|
+
await wixData.truncate(COLLECTIONS.CITIES);
|
|
357
|
+
console.log("clearing amount of jobs per department collection");
|
|
358
|
+
await wixData.truncate(COLLECTIONS.AMOUNT_OF_JOBS_PER_DEPARTMENT);
|
|
359
|
+
console.log("clearing jobs collection");
|
|
360
|
+
await wixData.truncate(COLLECTIONS.JOBS);
|
|
361
|
+
console.log("cleared collections successfully");
|
|
362
|
+
}
|
|
363
|
+
|
|
359
364
|
module.exports = {
|
|
360
365
|
syncJobsFast,
|
|
361
366
|
referenceJobs,
|