sr-npm 1.7.42 → 1.7.44
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 +4 -5
- package/package.json +1 -1
package/backend/data.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
const { items: wixData } = require('@wix/data');
|
|
2
2
|
const { fetchPositionsFromSRAPI, fetchJobDescription } = require('./fetchPositionsFromSRAPI');
|
|
3
3
|
const { chunkedBulkOperation, delay, countJobsPerGivenField, fillCityLocation ,prepateToSaveArray,normalizeCityName} = require('./utils');
|
|
4
|
-
const { QUERY_MAX_LIMIT,COLLECTIONS } = require('./consts');
|
|
5
4
|
const { getAllPositions } = require('./queries');
|
|
6
5
|
|
|
7
6
|
|
|
@@ -94,7 +93,7 @@ async function saveJobsDescriptionsAndLocationToCMS() {
|
|
|
94
93
|
locationAddress: jobLocation,
|
|
95
94
|
jobDescription: jobDetails.jobAd.sections,
|
|
96
95
|
};
|
|
97
|
-
await wixData.update(
|
|
96
|
+
await wixData.update('Jobs1', updatedJob);
|
|
98
97
|
return { success: true, jobId: job._id, title: job.title };
|
|
99
98
|
} catch (error) {
|
|
100
99
|
console.error(` ❌ Failed to update ${job.title} (${job._id}):`, error);
|
|
@@ -178,8 +177,8 @@ async function aggregateJobsByFieldToCMS({ field, collection }) {
|
|
|
178
177
|
|
|
179
178
|
async function getJobsWithNoDescriptions() {
|
|
180
179
|
let jobswithoutdescriptionsQuery = await wixData
|
|
181
|
-
.query(
|
|
182
|
-
.limit(
|
|
180
|
+
.query('Jobs1')
|
|
181
|
+
.limit(1000)
|
|
183
182
|
.isEmpty('jobDescription')
|
|
184
183
|
.find();
|
|
185
184
|
return jobswithoutdescriptionsQuery;
|
|
@@ -193,7 +192,7 @@ async function getJobsWithNoDescriptions() {
|
|
|
193
192
|
*/
|
|
194
193
|
async function referenceJobsToField({ referenceField, sourceCollection, jobField }) {
|
|
195
194
|
// Fetch all source items (cities or departments)
|
|
196
|
-
const sources = await wixData.query(sourceCollection).limit(
|
|
195
|
+
const sources = await wixData.query(sourceCollection).limit(1000).find();
|
|
197
196
|
const sourceMap = {};
|
|
198
197
|
for (const item of sources.items) {
|
|
199
198
|
sourceMap[item.title] = item._id;
|