sr-npm 1.7.207 → 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 -0
- package/package.json +1 -1
package/backend/data.js
CHANGED
|
@@ -335,6 +335,7 @@ async function syncJobsFast() {
|
|
|
335
335
|
console.log("Creating collections");
|
|
336
336
|
await createCollections();
|
|
337
337
|
console.log("created collections successfully");
|
|
338
|
+
await clearCollections();
|
|
338
339
|
console.log("saving jobs data to CMS");
|
|
339
340
|
await saveJobsDataToCMS();
|
|
340
341
|
console.log("saved jobs data to CMS successfully");
|
|
@@ -350,6 +351,16 @@ async function syncJobsFast() {
|
|
|
350
351
|
console.log("syncing jobs fast finished successfully");
|
|
351
352
|
}
|
|
352
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
|
+
|
|
353
364
|
module.exports = {
|
|
354
365
|
syncJobsFast,
|
|
355
366
|
referenceJobs,
|