Skip to content

Commit

Permalink
fix filter
Browse files Browse the repository at this point in the history
  • Loading branch information
Margo63 committed Nov 7, 2024
1 parent 0f35cec commit bcb4ff4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions front/cats/src/ui/filter.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,14 @@ export const FilterComponent = () => {
return (
<div>
<Button onClick={() => {

const filter_data = {
filter_number: checkedNumbers,
filter_string: checkedString,
filter_number: JSON.parse(JSON.stringify(checkedNumbers)),
filter_string: JSON.parse(JSON.stringify(checkedString)),
filter_list: [],
}
if(isTemperamentChecked)
filter_data.filter_list = checkedTemperament
filter_data.filter_list = JSON.parse(JSON.stringify(checkedTemperament))

dispatch(updateFilter(filter_data))
}}> Filter Data</Button>
Expand Down Expand Up @@ -104,6 +105,7 @@ export const FilterComponent = () => {
} else {
const index = checkedNumbers.findIndex(itemm => itemm.id === item.id);
if (index !== -1) {
//alert(JSON.stringify(checkedNumbers[index]))
checkedNumbers[index].from = Number(e.target.value);
}
filter_data_numbers[Number(item.id) - 1].from = Number(e.target.value);
Expand Down

0 comments on commit bcb4ff4

Please sign in to comment.