I have two objects:
filter: {
brand: [],
size: [],
orderBy: 1,
page: 1,
pageSize: 15,
search: search,
condition: [],
gender: [],
offeredBy: [],
color: []
};
tmpFilters: {
brand: [],
size: [],
orderBy: 1,
page: 1,
pageSize: 15,
search: search,
condition: [],
gender: [],
offeredBy: [],
color: []
};
My goal is to set the filters to the value of temporary filters. Here is what I have already tried but not working.
let newObj = { ...tmpFilters };
await setFilter(newObj);
console.log(filter);
When I write out the filter in the console, it says that the value wasn't changed. I have check the other answers but nothing seems to work.