sr-npm 1.7.414 → 1.7.416

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.
@@ -2,7 +2,7 @@ const { fetch } = require('wix-fetch');
2
2
  const { items: wixData } = require('@wix/data');
3
3
  const { COLLECTIONS } = require('./collectionConsts');
4
4
 
5
- async function makeSmartRecruitersRequest(path) {
5
+ async function makeSmartRecruitersRequest(path,templateType) {
6
6
  const baseUrl = 'https://api.smartrecruiters.com';
7
7
  const fullUrl = `${baseUrl}${path}`;
8
8
 
@@ -14,9 +14,9 @@ async function makeSmartRecruitersRequest(path) {
14
14
  'Cookie': 'AWSALB=GYltFw3fLKortMxHR5vIOT1CuUROyhWNIX/qL8ZnPl1/8mhOcnIsBKYslzmNJPEzSy/jvNbO+6tXpH8yqcpQJagYt57MhbKlLqTSzoNq1G/w7TjOxPGR3UTdXW0d; AWSALBCORS=GYltFw3fLKortMxHR5vIOT1CuUROyhWNIX/qL8ZnPl1/8mhOcnIsBKYslzmNJPEzSy/jvNbO+6tXpH8yqcpQJagYt57MhbKlLqTSzoNq1G/w7TjOxPGR3UTdXW0d'
15
15
  };
16
16
  //here is the only place where we check templateType
17
- const templateType = await getTemplateTypeFromCMS();
18
17
  if (templateType === 'INTERNAL') {
19
18
  const smartToken = await getSmartTokenFromCMS();
19
+ console.log("smartToken is ",smartToken);
20
20
  headers['x-smarttoken'] = smartToken;
21
21
  }
22
22
  const response = await fetch(fullUrl, {
@@ -52,7 +52,7 @@ async function fetchPositionsFromSRAPI() {
52
52
  const apiPath = `/v1/companies/${companyId}/postings?offset=${offset}&destination=${templateType}`;
53
53
 
54
54
  console.log(`Fetching page ${page} with path: ${apiPath}`);
55
- const response = await makeSmartRecruitersRequest(apiPath);
55
+ const response = await makeSmartRecruitersRequest(apiPath,templateType);
56
56
 
57
57
  // Add positions from this page to our collection
58
58
  if (response.content && Array.isArray(response.content)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sr-npm",
3
- "version": "1.7.414",
3
+ "version": "1.7.416",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {