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) => {
|
(e) => {
|
||||||
const val = e.target.value;
|
const val = e.target.value;
|
||||||
updateFilter('weight_min', val ? String(parseInt(val, 10)) : '');
|
updateFilter('weight_min', val ? String(parseFloat(val) || 0) : '');
|
||||||
setIsSubmitted(false);
|
setIsSubmitted(false);
|
||||||
},
|
},
|
||||||
[updateFilter]
|
[updateFilter]
|
||||||
@@ -128,7 +128,7 @@ const HppPerKandangTab = () => {
|
|||||||
>(
|
>(
|
||||||
(e) => {
|
(e) => {
|
||||||
const val = e.target.value;
|
const val = e.target.value;
|
||||||
updateFilter('weight_max', val ? String(parseInt(val, 10)) : '');
|
updateFilter('weight_max', val ? String(parseFloat(val) || 0) : '');
|
||||||
setIsSubmitted(false);
|
setIsSubmitted(false);
|
||||||
},
|
},
|
||||||
[updateFilter]
|
[updateFilter]
|
||||||
@@ -189,12 +189,8 @@ const HppPerKandangTab = () => {
|
|||||||
tableFilterState.kandang_id.length > 0
|
tableFilterState.kandang_id.length > 0
|
||||||
? tableFilterState.kandang_id.join(',')
|
? tableFilterState.kandang_id.join(',')
|
||||||
: undefined,
|
: undefined,
|
||||||
weight_min: tableFilterState.weight_min
|
weight_min: tableFilterState.weight_min || undefined,
|
||||||
? Number(tableFilterState.weight_min)
|
weight_max: tableFilterState.weight_max || undefined,
|
||||||
: undefined,
|
|
||||||
weight_max: tableFilterState.weight_max
|
|
||||||
? Number(tableFilterState.weight_max)
|
|
||||||
: undefined,
|
|
||||||
period: tableFilterState.period || undefined,
|
period: tableFilterState.period || undefined,
|
||||||
sort_by: tableFilterState.sort_by || undefined,
|
sort_by: tableFilterState.sort_by || undefined,
|
||||||
show_unrecorded: tableFilterState.show_unrecorded,
|
show_unrecorded: tableFilterState.show_unrecorded,
|
||||||
@@ -250,12 +246,8 @@ const HppPerKandangTab = () => {
|
|||||||
tableFilterState.kandang_id.length > 0
|
tableFilterState.kandang_id.length > 0
|
||||||
? tableFilterState.kandang_id.join(',')
|
? tableFilterState.kandang_id.join(',')
|
||||||
: undefined,
|
: undefined,
|
||||||
weight_min: tableFilterState.weight_min
|
weight_min: tableFilterState.weight_min || undefined,
|
||||||
? Number(tableFilterState.weight_min)
|
weight_max: tableFilterState.weight_max || undefined,
|
||||||
: undefined,
|
|
||||||
weight_max: tableFilterState.weight_max
|
|
||||||
? Number(tableFilterState.weight_max)
|
|
||||||
: undefined,
|
|
||||||
period: tableFilterState.period || undefined,
|
period: tableFilterState.period || undefined,
|
||||||
sort_by: tableFilterState.sort_by || undefined,
|
sort_by: tableFilterState.sort_by || undefined,
|
||||||
show_unrecorded: tableFilterState.show_unrecorded,
|
show_unrecorded: tableFilterState.show_unrecorded,
|
||||||
|
|||||||
@@ -15,8 +15,8 @@ export class MarketingSaleReportService extends BaseApiService<
|
|||||||
area_id?: string,
|
area_id?: string,
|
||||||
location_id?: string,
|
location_id?: string,
|
||||||
kandang_id?: string,
|
kandang_id?: string,
|
||||||
weight_min?: number,
|
weight_min?: string,
|
||||||
weight_max?: number,
|
weight_max?: string,
|
||||||
period?: string,
|
period?: string,
|
||||||
sort_by?: string,
|
sort_by?: string,
|
||||||
show_unrecorded?: boolean,
|
show_unrecorded?: boolean,
|
||||||
|
|||||||
Reference in New Issue
Block a user