So I have 2 arrays of objects: planned, backlog.
const planned = [
{
order_number: "1",
part_name: "example",
part_number: "1",
process_id: 1
},
....
];
const backlog = [
{
order_number: "2",
part_name: "example",
part_number: "2",
process_id: 2
},
....
];
I am trying to filter both of them at the same time, each one individually that's not a problem.
So what I am actually doing is first adding key of planned to planned array and backlog to backlog array in order to know later from where the order originally came from.
var newPlanned = planned.map(function (el) {
var o = Object.assign({}, el);
o.planned = true;
return o;
});
var newBacklog = backlog.map(function (el) {
var o = Object.assign({}, el);
o.backlog = true;
return o;
});
Later I am merging the 2 arrays into 1 array, and filtering the merged array with one input onChange, but what I can't achieve is to render the "planned" and "backlog" arrays separately from the new merged array.
const newPlannedAndBacklog = [...newBacklog, ...newPlanned];
Link to codeSandBox: SandBox