sr-npm 1.7.558 → 1.7.560

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 +9 -5
  2. package/package.json +1 -1
package/backend/data.js CHANGED
@@ -153,7 +153,7 @@ async function saveJobsDataToCMS() {
153
153
 
154
154
  await insertValuesReference(jobToCustomValues);
155
155
  console.log("inserted values reference successfully");
156
- await insertJobsReference(customValuesToJobs);
156
+ //await insertJobsReference(customValuesToJobs);
157
157
  console.log("inserted jobs reference successfully");
158
158
 
159
159
  console.log(`✓ All chunks processed. Total jobs saved: ${totalSaved}/${jobsData.length}`);
@@ -177,24 +177,28 @@ async function insertJobsReference(customValuesToJobs) {
177
177
  }
178
178
 
179
179
  async function populateCustomFieldsCollection(customFields) {
180
+ fieldstoinsert=[]
180
181
  for(const ID of Object.keys(customFields)){
181
- await wixData.save(COLLECTIONS.CUSTOM_FIELDS, {
182
+ fieldstoinsert.push({
182
183
  title: customFields[ID],
183
184
  _id: ID,
184
- });
185
+ })
185
186
  }
187
+ await wixData.bulkSave(COLLECTIONS.CUSTOM_FIELDS, fieldstoinsert);
186
188
  }
187
189
  async function populateCustomValuesCollection(customFieldsValues) {
190
+ valuesToinsert=[]
188
191
  for (const fieldId of Object.keys(customFieldsValues)) {
189
192
  const valuesMap = customFieldsValues[fieldId] || {};
190
193
  for (const valueId of Object.keys(valuesMap)) {
191
- await wixData.save(COLLECTIONS.CUSTOM_VALUES, {
194
+ valuesToinsert.push({
192
195
  _id: valueId,
193
196
  title: valuesMap[valueId],
194
197
  customField: fieldId, // reference to CustomFields collection (displays the label)
195
- });
198
+ })
196
199
  }
197
200
  }
201
+ await wixData.bulkSave(COLLECTIONS.CUSTOM_VALUES, valuesToinsert);
198
202
  }
199
203
  async function saveJobsDescriptionsAndLocationApplyUrlToCMS() {
200
204
  console.log('🚀 Starting job descriptions update process for ALL jobs');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sr-npm",
3
- "version": "1.7.558",
3
+ "version": "1.7.560",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {