sr-npm 1.7.171 → 1.7.174

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
@@ -27,7 +27,6 @@ function validatePosition(position) {
27
27
  async function saveJobsDataToCMS() {
28
28
  const positions = await fetchPositionsFromSRAPI();
29
29
  // bulk insert to jobs collection without descriptions first
30
- console.log("positions@@@@@", positions);
31
30
  const jobsData = positions.content.map(position => {
32
31
  const basicJob = {
33
32
  _id: position.id,
@@ -40,7 +39,7 @@ async function saveJobsDataToCMS() {
40
39
  // language: position.language.label,
41
40
  // postingStatus: position.postingStatus,
42
41
  title: position.title || '',
43
- department: position.department?.label || '',
42
+ department: position.department?.label || 'Other',
44
43
  cityText: normalizeCityName(position.location?.city),
45
44
  location: position.location || {},
46
45
  country: position.location?.country || '',
@@ -54,8 +54,12 @@ async function fetchPositionsFromSRAPI() {
54
54
 
55
55
  // Add positions from this page to our collection
56
56
  if (response.content && Array.isArray(response.content)) {
57
- allPositions = allPositions.concat(response.content);
58
- console.log(`Page ${page}: Found ${response.content.length} positions`);
57
+ // Filter out positions with postingStatus "NOT_PUBLISHED"
58
+ const publishedPositions = response.content.filter(position =>
59
+ position.postingStatus !== "NOT_PUBLISHED"
60
+ );
61
+ allPositions = allPositions.concat(publishedPositions);
62
+ console.log(`Page ${page}: Found ${response.content.length} positions, ${publishedPositions.length} published`);
59
63
  }
60
64
 
61
65
  // Update total count from first response
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sr-npm",
3
- "version": "1.7.171",
3
+ "version": "1.7.174",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {