sr-npm 1.7.1233 → 1.7.1234
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 +5 -2
- package/package.json +1 -1
package/backend/data.js
CHANGED
|
@@ -532,13 +532,16 @@ async function syncJobsFast() {
|
|
|
532
532
|
|
|
533
533
|
async function clearCollections() {
|
|
534
534
|
console.log("clearing collections");
|
|
535
|
+
if(siteconfig===undefined) {
|
|
536
|
+
await getSiteConfig();
|
|
537
|
+
}
|
|
535
538
|
await Promise.all([
|
|
536
539
|
wixData.truncate(COLLECTIONS.CITIES),
|
|
537
540
|
wixData.truncate(COLLECTIONS.AMOUNT_OF_JOBS_PER_DEPARTMENT),
|
|
538
541
|
wixData.truncate(COLLECTIONS.JOBS),
|
|
539
542
|
wixData.truncate(COLLECTIONS.BRANDS),
|
|
540
|
-
wixData.truncate(COLLECTIONS.CUSTOM_VALUES),
|
|
541
|
-
wixData.truncate(COLLECTIONS.CUSTOM_FIELDS),
|
|
543
|
+
siteconfig.customFields==="true" ? wixData.truncate(COLLECTIONS.CUSTOM_VALUES) : null,
|
|
544
|
+
siteconfig.customFields==="true" ? wixData.truncate(COLLECTIONS.CUSTOM_FIELDS) : null,
|
|
542
545
|
]);
|
|
543
546
|
console.log("cleared collections successfully");
|
|
544
547
|
}
|