mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-20 13:32:00 +00:00
refactor(FE): Set default value for show_unrecorded to false
This commit is contained in:
@@ -110,7 +110,7 @@ const HppPerKandangTab = ({ tabId }: HppPerKandangTabProps) => {
|
|||||||
weight_max: null,
|
weight_max: null,
|
||||||
period: null,
|
period: null,
|
||||||
sort_by: null,
|
sort_by: null,
|
||||||
show_unrecorded: null,
|
show_unrecorded: false,
|
||||||
},
|
},
|
||||||
validationSchema: HppPerKandangFilterSchema,
|
validationSchema: HppPerKandangFilterSchema,
|
||||||
onSubmit: (values, { setSubmitting }) => {
|
onSubmit: (values, { setSubmitting }) => {
|
||||||
@@ -122,8 +122,7 @@ const HppPerKandangTab = ({ tabId }: HppPerKandangTabProps) => {
|
|||||||
weight_max: values.weight_max || undefined,
|
weight_max: values.weight_max || undefined,
|
||||||
period: values.period || undefined,
|
period: values.period || undefined,
|
||||||
sort_by: values.sort_by || undefined,
|
sort_by: values.sort_by || undefined,
|
||||||
show_unrecorded:
|
show_unrecorded: values.show_unrecorded ?? undefined,
|
||||||
values.show_unrecorded !== null ? values.show_unrecorded : undefined,
|
|
||||||
});
|
});
|
||||||
filterModal.closeModal();
|
filterModal.closeModal();
|
||||||
setIsSubmitted(true);
|
setIsSubmitted(true);
|
||||||
@@ -1026,7 +1025,11 @@ const HppPerKandangTab = ({ tabId }: HppPerKandangTabProps) => {
|
|||||||
if (!Array.isArray(val)) {
|
if (!Array.isArray(val)) {
|
||||||
formik.setFieldValue(
|
formik.setFieldValue(
|
||||||
'show_unrecorded',
|
'show_unrecorded',
|
||||||
val?.value === 'true' || null
|
val?.value === 'true'
|
||||||
|
? true
|
||||||
|
: val?.value === 'false'
|
||||||
|
? false
|
||||||
|
: null
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ export class MarketingSaleReportService extends BaseApiService<
|
|||||||
weight_max: weight_max,
|
weight_max: weight_max,
|
||||||
period: period,
|
period: period,
|
||||||
sort_by: sort_by,
|
sort_by: sort_by,
|
||||||
show_unrecorded: show_unrecorded,
|
show_unrecorded: show_unrecorded ?? false,
|
||||||
page: page,
|
page: page,
|
||||||
limit: limit,
|
limit: limit,
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user