sr-npm 1.7.106 → 1.7.108
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
CHANGED
|
@@ -18,7 +18,7 @@ function validatePosition(position) {
|
|
|
18
18
|
if (!position.department || !position.department.label) {
|
|
19
19
|
throw new Error('Position department is required and must have a label');
|
|
20
20
|
}
|
|
21
|
-
if (!position.location || !position.location.city ||
|
|
21
|
+
if (!position.location || !position.location.city || typeof position.location.remote !== 'boolean') {
|
|
22
22
|
throw new Error('Position location is required and must have a city and remote');
|
|
23
23
|
}
|
|
24
24
|
|
|
@@ -32,7 +32,7 @@ async function saveJobsDataToCMS() {
|
|
|
32
32
|
const basicJob = {
|
|
33
33
|
_id: position.id,
|
|
34
34
|
title: position.title,
|
|
35
|
-
department: position.department.label,
|
|
35
|
+
department: position.department.label.replace('&', ' and '),
|
|
36
36
|
cityText: normalizeCityName(position.location.city),
|
|
37
37
|
location: position.location,
|
|
38
38
|
country: position.location.country,
|
|
@@ -130,10 +130,6 @@ async function saveJobsDescriptionsAndLocationApplyUrlToCMS() {
|
|
|
130
130
|
console.log(
|
|
131
131
|
` API chunk ${chunkNumber} completed: ${chunkSuccesses} success, ${chunkFailures} failed`
|
|
132
132
|
);
|
|
133
|
-
if (chunkNumber * API_CHUNK_SIZE < jobsWithNoDescriptions.items.length) {
|
|
134
|
-
console.log(' Waiting 2 seconds before next API chunk...');
|
|
135
|
-
await delay(2000);
|
|
136
|
-
}
|
|
137
133
|
},
|
|
138
134
|
});
|
|
139
135
|
|
|
@@ -158,6 +154,7 @@ async function saveJobsDescriptionsAndLocationApplyUrlToCMS() {
|
|
|
158
154
|
}
|
|
159
155
|
}
|
|
160
156
|
|
|
157
|
+
|
|
161
158
|
function iterateOverAllJobs(results, field) {
|
|
162
159
|
const jobsPerField = {};
|
|
163
160
|
const cityLocations = {};
|
|
@@ -3,7 +3,7 @@ const { items: wixData } = require('@wix/data');
|
|
|
3
3
|
const { COLLECTIONS } = require('./collectionConsts');
|
|
4
4
|
async function makeSmartRecruitersRequest(path,token) {
|
|
5
5
|
const baseUrl = 'https://api.smartrecruiters.com'; // PROD
|
|
6
|
-
|
|
6
|
+
// const baseUrl = 'https://bayank2.wixstudio.com/my-site-3//_functions'; // TEST
|
|
7
7
|
const fullUrl = `${baseUrl}${path}`;
|
|
8
8
|
|
|
9
9
|
//console.log(`Making request to: ${fullUrl}`);
|