sr-npm 1.7.644 → 1.7.646
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/package.json +1 -1
- package/pages/careersMultiBoxesPage.js +23 -20
package/package.json
CHANGED
|
@@ -232,42 +232,45 @@ async function loadJobs(_$w) {
|
|
|
232
232
|
}
|
|
233
233
|
|
|
234
234
|
async function applyJobFilters(_$w,filterByField) {
|
|
235
|
-
let q = wixData.query(COLLECTIONS.JOBS)
|
|
235
|
+
//let q = wixData.query(COLLECTIONS.JOBS)
|
|
236
236
|
console.log(currentJobs)
|
|
237
237
|
let newFilteredJobs=[]
|
|
238
|
-
let
|
|
239
|
-
console.log("selectedByField: ",selectedByField)
|
|
238
|
+
let addedJobsIds=[]
|
|
239
|
+
//console.log("selectedByField: ",selectedByField)
|
|
240
240
|
|
|
241
241
|
// AND across categories, OR within each category
|
|
242
242
|
for (const [, values] of selectedByField.entries()) {
|
|
243
|
-
|
|
243
|
+
// console.log("values: ",values)
|
|
244
244
|
for(job of currentJobs) {
|
|
245
|
-
console.log("job: ",job)
|
|
246
|
-
console.log("job[filterByField]: ",job[filterByField])
|
|
247
|
-
|
|
248
|
-
if(job[filterByField].some(value=>values.includes(value))) {
|
|
249
|
-
|
|
250
|
-
if(!
|
|
245
|
+
//console.log("job: ",job)
|
|
246
|
+
//console.log("job[filterByField]: ",job[filterByField])
|
|
247
|
+
// console.log("job[filterByField].some(value=>values.includes(value))) ",job[filterByField].some(value=>values.includes(value._id)))
|
|
248
|
+
if(job[filterByField].some(value=>values.includes(value._id))) {
|
|
249
|
+
// console.log("!alreadyAddedJobs.includes(job._id) ",!alreadyAddedJobs.includes(job._id))
|
|
250
|
+
if(!addedJobsIds.includes(job._id)) {
|
|
251
251
|
newFilteredJobs.push(job);
|
|
252
|
-
|
|
252
|
+
addedJobsIds.push(job._id);
|
|
253
253
|
}
|
|
254
254
|
}
|
|
255
255
|
}
|
|
256
256
|
|
|
257
|
-
|
|
257
|
+
// if (values && values.length) {
|
|
258
258
|
|
|
259
|
-
|
|
259
|
+
// q = q.hasSome(filterByField, values);
|
|
260
260
|
|
|
261
|
-
|
|
261
|
+
// }
|
|
262
262
|
}
|
|
263
|
-
console.log("alreadyAddedJobs: ",alreadyAddedJobs)
|
|
263
|
+
//console.log("alreadyAddedJobs: ",alreadyAddedJobs)
|
|
264
264
|
console.log("newFilteredJobs: ",newFilteredJobs)
|
|
265
|
+
currentJobs=newFilteredJobs;
|
|
266
|
+
currentJobsIds=addedJobsIds;
|
|
267
|
+
_$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.JOBS_REPEATER).data = newFilteredJobs;
|
|
265
268
|
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
269
|
+
// await q.find()
|
|
270
|
+
// .then(async (res) => { _$w(CAREERS_MULTI_BOXES_PAGE_CONSTS.JOBS_REPEATER).data = res.items;
|
|
271
|
+
// await updateCurrentJobs(res);
|
|
272
|
+
// })
|
|
273
|
+
// .catch((err) => { console.error('Failed to filter jobs:', err); });
|
|
271
274
|
}
|
|
272
275
|
|
|
273
276
|
|