mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-20 13:32:00 +00:00
refactor(FE-357): Use string weights and parse floats for filters
This commit is contained in:
@@ -117,7 +117,7 @@ const HppPerKandangTab = () => {
|
||||
>(
|
||||
(e) => {
|
||||
const val = e.target.value;
|
||||
updateFilter('weight_min', val ? String(parseInt(val, 10)) : '');
|
||||
updateFilter('weight_min', val ? String(parseFloat(val) || 0) : '');
|
||||
setIsSubmitted(false);
|
||||
},
|
||||
[updateFilter]
|
||||
@@ -128,7 +128,7 @@ const HppPerKandangTab = () => {
|
||||
>(
|
||||
(e) => {
|
||||
const val = e.target.value;
|
||||
updateFilter('weight_max', val ? String(parseInt(val, 10)) : '');
|
||||
updateFilter('weight_max', val ? String(parseFloat(val) || 0) : '');
|
||||
setIsSubmitted(false);
|
||||
},
|
||||
[updateFilter]
|
||||
@@ -189,12 +189,8 @@ const HppPerKandangTab = () => {
|
||||
tableFilterState.kandang_id.length > 0
|
||||
? tableFilterState.kandang_id.join(',')
|
||||
: undefined,
|
||||
weight_min: tableFilterState.weight_min
|
||||
? Number(tableFilterState.weight_min)
|
||||
: undefined,
|
||||
weight_max: tableFilterState.weight_max
|
||||
? Number(tableFilterState.weight_max)
|
||||
: undefined,
|
||||
weight_min: tableFilterState.weight_min || undefined,
|
||||
weight_max: tableFilterState.weight_max || undefined,
|
||||
period: tableFilterState.period || undefined,
|
||||
sort_by: tableFilterState.sort_by || undefined,
|
||||
show_unrecorded: tableFilterState.show_unrecorded,
|
||||
@@ -250,12 +246,8 @@ const HppPerKandangTab = () => {
|
||||
tableFilterState.kandang_id.length > 0
|
||||
? tableFilterState.kandang_id.join(',')
|
||||
: undefined,
|
||||
weight_min: tableFilterState.weight_min
|
||||
? Number(tableFilterState.weight_min)
|
||||
: undefined,
|
||||
weight_max: tableFilterState.weight_max
|
||||
? Number(tableFilterState.weight_max)
|
||||
: undefined,
|
||||
weight_min: tableFilterState.weight_min || undefined,
|
||||
weight_max: tableFilterState.weight_max || undefined,
|
||||
period: tableFilterState.period || undefined,
|
||||
sort_by: tableFilterState.sort_by || undefined,
|
||||
show_unrecorded: tableFilterState.show_unrecorded,
|
||||
|
||||
Reference in New Issue
Block a user