This is my nuxt js code in one of the methods.
this.allCampusWithDeaprtments = campusData.map(
(item, index) => {
const schoolData = this.deptInsights.filter((row) => {
return row.unit === item.unit;
}).map(row => {
// row.departmentData = row.departmentData || [];
// row.departmentData.push(...this.depts.filter((d) => {
// return d.sisSchoolId === row.sisSchoolId;
// }));
// return row;
const departmentData = this.depts.filter(
d => d.sisSchoolId === row.sisSchoolId
);
return departmentData
});
console.log('department', departmentData);
// );
item.id = `toggle-${index}`;
return {
...item,
schoolData,
// departmentData,
hasOerData: false
};
}
);
departmentData is not returning any value. What could be the problem? i wand the data which matches the mentioned case in the code
(row) => {…}function returns nothing, so the filtered list is empty.const departmentDatais never used. WhateverdepartmentDatais outside, it has nothing to do with thedepartmentDatainside thefilter, because it’s out of scope.