sr-npm 1.7.564 → 1.7.565
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 +2 -26
- package/package.json +1 -1
package/backend/data.js
CHANGED
|
@@ -114,9 +114,6 @@ async function saveJobsDataToCMS() {
|
|
|
114
114
|
return basicJob;
|
|
115
115
|
});
|
|
116
116
|
|
|
117
|
-
console.log("customFieldsLabels: ", customFieldsLabels);
|
|
118
|
-
console.log("customFieldsValues: ", customFieldsValues);
|
|
119
|
-
console.log("jobToCustomValues: ", jobToCustomValues);
|
|
120
117
|
await populateCustomFieldsCollection(customFieldsLabels);
|
|
121
118
|
await populateCustomValuesCollection(customFieldsValues);
|
|
122
119
|
// Sort jobs by title (ascending, case-insensitive, numeric-aware)
|
|
@@ -153,32 +150,14 @@ async function saveJobsDataToCMS() {
|
|
|
153
150
|
}
|
|
154
151
|
},
|
|
155
152
|
});
|
|
156
|
-
|
|
157
|
-
// await insertValuesReference(jobToCustomValues);
|
|
158
|
-
// console.log("inserted values reference successfully");
|
|
159
|
-
// //await insertJobsReference(customValuesToJobs);
|
|
160
|
-
// console.log("inserted jobs reference successfully");
|
|
161
|
-
|
|
162
153
|
console.log(`✓ All chunks processed. Total jobs saved: ${totalSaved}/${jobsData.length}`);
|
|
163
154
|
}
|
|
164
155
|
|
|
165
156
|
async function insertValuesReference(jobId) {
|
|
166
157
|
await wixData.insertReference(COLLECTIONS.JOBS, JOBS_COLLECTION_FIELDS.MULTI_REF_JOBS_CUSTOM_VALUES,jobId, jobToCustomValues[jobId]);
|
|
167
|
-
// console.log("inserting values reference");
|
|
168
|
-
// for (const jobId of Object.keys(jobToCustomValues)) {
|
|
169
|
-
// const items = jobToCustomValues[jobId];
|
|
170
|
-
// await wixData.insertReference(COLLECTIONS.JOBS, JOBS_COLLECTION_FIELDS.MULTI_REF_JOBS_CUSTOM_VALUES,jobId, items);
|
|
171
|
-
// }
|
|
172
|
-
// console.log("inserted values reference successfully");
|
|
173
158
|
}
|
|
174
159
|
async function insertJobsReference(valueId) {
|
|
175
160
|
await wixData.insertReference(COLLECTIONS.CUSTOM_VALUES, CUSTOM_VALUES_COLLECTION_FIELDS.MULTI_REF_JOBS_CUSTOM_VALUES,valueId, customValuesToJobs[valueId]);
|
|
176
|
-
// console.log("inserting jobs reference");
|
|
177
|
-
// for (const valueId of Object.keys(customValuesToJobs)) {
|
|
178
|
-
// const items = customValuesToJobs[valueId];
|
|
179
|
-
// await wixData.insertReference(COLLECTIONS.CUSTOM_VALUES, CUSTOM_VALUES_COLLECTION_FIELDS.MULTI_REF_JOBS_CUSTOM_VALUES,valueId, items);
|
|
180
|
-
// }
|
|
181
|
-
// console.log("inserted jobs reference successfully");
|
|
182
161
|
}
|
|
183
162
|
|
|
184
163
|
async function populateCustomFieldsCollection(customFields) {
|
|
@@ -211,15 +190,12 @@ async function saveJobsDescriptionsAndLocationApplyUrlReferencesToCMS() {
|
|
|
211
190
|
try {
|
|
212
191
|
let jobsWithNoDescriptions = await getJobsWithNoDescriptions();
|
|
213
192
|
let customValues=await getAllCustomValues();
|
|
214
|
-
console.log("customValues: ", customValues);
|
|
215
|
-
console.log("jobToCustomValues: ", jobToCustomValues);
|
|
216
|
-
console.log("customValuesToJobs: ", customValuesToJobs);
|
|
217
193
|
|
|
218
|
-
console.log("inserting jobs references");
|
|
194
|
+
console.log("inserting jobs references to custom values collection");
|
|
219
195
|
for (const value of customValues.items) {
|
|
220
196
|
await insertJobsReference(value._id);
|
|
221
197
|
}
|
|
222
|
-
console.log("inserted jobs references successfully");
|
|
198
|
+
console.log("inserted jobs references to custom values collection successfully");
|
|
223
199
|
|
|
224
200
|
|
|
225
201
|
let totalUpdated = 0;
|