I am facing an issue with a getter in VUEX where I am attempting to filter an array nested inside another array. However, I keep receiving a warning about modifying the state within the getter.
Error: [vuex] do not mutate vuex store state outside mutation handlers
I have tried filtering the top-level array but it doesn't work for the nested people array. The only workaround that seems to make it work is by using the following code snippet (even though it's incorrect)
for (const company of company.companies) {
const filteredPeople: IPerson[] = company.people.filter(
x => x.jobId === 1
);
company.people = filteredPeople;
}