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,
|
||||
period: null,
|
||||
sort_by: null,
|
||||
show_unrecorded: null,
|
||||
show_unrecorded: false,
|
||||
},
|
||||
validationSchema: HppPerKandangFilterSchema,
|
||||
onSubmit: (values, { setSubmitting }) => {
|
||||
@@ -122,8 +122,7 @@ const HppPerKandangTab = ({ tabId }: HppPerKandangTabProps) => {
|
||||
weight_max: values.weight_max || undefined,
|
||||
period: values.period || undefined,
|
||||
sort_by: values.sort_by || undefined,
|
||||
show_unrecorded:
|
||||
values.show_unrecorded !== null ? values.show_unrecorded : undefined,
|
||||
show_unrecorded: values.show_unrecorded ?? undefined,
|
||||
});
|
||||
filterModal.closeModal();
|
||||
setIsSubmitted(true);
|
||||
@@ -1026,7 +1025,11 @@ const HppPerKandangTab = ({ tabId }: HppPerKandangTabProps) => {
|
||||
if (!Array.isArray(val)) {
|
||||
formik.setFieldValue(
|
||||
'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,
|
||||
period: period,
|
||||
sort_by: sort_by,
|
||||
show_unrecorded: show_unrecorded,
|
||||
show_unrecorded: show_unrecorded ?? false,
|
||||
page: page,
|
||||
limit: limit,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user