sr-npm 1.7.663 → 1.7.665

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
@@ -11,7 +11,7 @@ const { retrieveSecretVal, getTokenFromCMS } = require('./secretsData');
11
11
  let customValuesToJobs = {}
12
12
  let locationToJobs = {}
13
13
  let siteconfig;
14
- const EXCLUDED_CUSTOM_FIELDS = new Set(["Department"]);
14
+ const EXCLUDED_CUSTOM_FIELDS = new Set(["Department","COUNTRY"]);
15
15
 
16
16
  function getBrand(customField) {
17
17
  return customField.find(field => field.fieldLabel === 'Brands')?.valueLabel;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sr-npm",
3
- "version": "1.7.663",
3
+ "version": "1.7.665",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -237,20 +237,23 @@ async function loadJobs(_$w) {
237
237
  let tempFilteredJobs=[];
238
238
  let finalFilteredJobs=alljobs;
239
239
  let addedJobsIds=[]
240
- if(filterByField!="Location") {
241
- filterByField=JOBS_COLLECTION_FIELDS.MULTI_REF_JOBS_CUSTOM_VALUES;
242
- }
243
- else{
244
- filterByField=JOBS_COLLECTION_FIELDS.CITY_TEXT;
245
- }
240
+ // if(filterByField!="Location") {
241
+ // filterByField=JOBS_COLLECTION_FIELDS.MULTI_REF_JOBS_CUSTOM_VALUES;
242
+ // }
243
+ // else{
244
+ // filterByField=JOBS_COLLECTION_FIELDS.CITY_TEXT;
245
+ // }
246
+ console.log("filterByField: ",filterByField)
246
247
 
247
248
  console.log("selectedByField: ",selectedByField)
248
249
  // AND across categories, OR within each category
249
- for (const [, values] of selectedByField.entries()) {
250
+ for (const [key, values] of selectedByField.entries()) {
251
+ console.log("key: ",key)
252
+ console.log("values: ",values)
250
253
  for(job of finalFilteredJobs) {
251
- if(filterByField===JOBS_COLLECTION_FIELDS.CITY_TEXT){
254
+ if(key==="Location"){
252
255
  //if it is location then we check if selecred values (which is an array) have job city text
253
- if(values.includes(job[filterByField])) {
256
+ if(values.includes(job[JOBS_COLLECTION_FIELDS.CITY_TEXT])) {
254
257
  if(!addedJobsIds.includes(job._id)) {
255
258
  tempFilteredJobs.push(job);
256
259
  addedJobsIds.push(job._id);
@@ -259,7 +262,7 @@ async function loadJobs(_$w) {
259
262
  }
260
263
  else{
261
264
  //if it is not location then we check if selecred values (which is an array) have one of the job values (whcih is also an array)
262
- if(job[filterByField].some(value=>values.includes(value._id))) {
265
+ if(job[JOBS_COLLECTION_FIELDS.MULTI_REF_JOBS_CUSTOM_VALUES].some(value=>values.includes(value._id))) {
263
266
  if(!addedJobsIds.includes(job._id)) {
264
267
  tempFilteredJobs.push(job);
265
268
  addedJobsIds.push(job._id);