sr-npm 1.7.1218 → 1.7.1221

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
@@ -287,7 +287,7 @@ async function saveJobsDescriptionsAndLocationApplyUrlReferencesToCMS() {
287
287
  const chunkPromises = chunk.map(async job => {
288
288
  try {
289
289
  const jobDetails = await fetchJobDescription(job._id);
290
- const richContentDescription=await htmlRichContentConverter(jobDetails.jobAd.sections,richContentConverterToken);
290
+ const richContentDescription=await htmlRichContentConverter(jobDetails.jobAd.sections,richContentConverterToken,job.name);
291
291
  const jobLocation = fetchJobLocation(jobDetails);
292
292
  const {applyLink , referFriendLink} = fetchApplyAndReferFriendLink(jobDetails);
293
293
  const updatedJob = {
@@ -114,13 +114,16 @@ async function fetchJobDescription(jobId,testObject=undefined) {
114
114
  return await makeSmartRecruitersRequest(`/v1/companies/${companyId}/postings/${jobId}`,templateType);
115
115
  }
116
116
 
117
- async function htmlRichContentConverter(sections,richContentConverterToken) {
117
+ async function htmlRichContentConverter(sections,richContentConverterToken,title) {
118
+ console.log("title ====");
119
+ console.log(title);
120
+
118
121
  const richContentObject = {}
119
122
  for (const [sectionTitle, sectionData] of Object.entries(sections)) {
120
123
  if (sectionData.text) {
121
- const raw = JSON.stringify({
124
+ const raw = {
122
125
  content: sectionData.text,
123
- });
126
+ };
124
127
  const requestOptions = {
125
128
  method: 'post',
126
129
  headers: {
@@ -137,11 +140,14 @@ async function htmlRichContentConverter(sections,richContentConverterToken) {
137
140
  if (response.ok) {
138
141
  const data = await response.json();
139
142
  const richContentWithSpacing=addSpacingToRichContent(sectionData.text,data.richContent.richContent);
143
+ if(title===" Gardening Team Member - The Warehouse, Blenheim (Fixed Term)")
144
+ {
140
145
  console.log("richContentWithSpacing ====");
141
146
  console.log(richContentWithSpacing);
142
147
 
143
148
  console.log("data.richContent.richContent ====");
144
149
  console.log(data.richContent.richContent);
150
+ }
145
151
  richContentObject[sectionTitle] = richContentWithSpacing
146
152
  }
147
153
  else {
@@ -327,8 +333,6 @@ function createEmptyParagraph(id) {
327
333
 
328
334
 
329
335
 
330
-
331
-
332
336
  module.exports = {
333
337
  fetchPositionsFromSRAPI,
334
338
  fetchJobDescription,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sr-npm",
3
- "version": "1.7.1218",
3
+ "version": "1.7.1221",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {