mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-23 23:05:46 +00:00
fix(FE-51-54): fixing bug and layout form adjustment
This commit is contained in:
@@ -41,7 +41,6 @@ const CustomerForm = ({
|
||||
const [customerFormErrorMessage, setCustomerFormErrorMessage] = useState('');
|
||||
const [isDeleteLoading, setIsDeleteLoading] = useState(false);
|
||||
const [picSelectInputValue, setPicSelectInputValue] = useState('');
|
||||
const [typeSelectInputValue, setTypeSelectInputValue] = useState('');
|
||||
|
||||
// Fetch Data
|
||||
const picUrl = `${UserApi.basePath}?${new URLSearchParams({
|
||||
@@ -252,7 +251,6 @@ const CustomerForm = ({
|
||||
}
|
||||
onChange={typeChangeHandler}
|
||||
options={typeOptions}
|
||||
onInputChange={setTypeSelectInputValue}
|
||||
isError={formik.touched.type && Boolean(formik.errors.type)}
|
||||
errorMessage={formik.errors.type as string}
|
||||
isDisabled={formType === 'detail'}
|
||||
|
||||
@@ -42,8 +42,6 @@ const SupplierForm = ({
|
||||
// Setup State
|
||||
const [supplierFormErrorMessage, setSupplierFormErrorMessage] = useState('');
|
||||
const [isDeleteLoading, setIsDeleteLoading] = useState(false);
|
||||
const [typeSelectInputValue, setTypeSelectInputValue] = useState('');
|
||||
const [categorySelectInputValue, setCategorySelectInputValue] = useState('');
|
||||
const [hatcheryTagInputValue, setHatcheryTagInputValue] = useState('');
|
||||
|
||||
// -- Options data mapping
|
||||
@@ -108,8 +106,6 @@ const SupplierForm = ({
|
||||
};
|
||||
|
||||
// Memo
|
||||
console.log('Memo');
|
||||
console.log(initialValues);
|
||||
const formikInitialValues = useMemo<SupplierFormValues>(() => {
|
||||
return {
|
||||
name: initialValues?.name ?? '',
|
||||
@@ -125,7 +121,7 @@ const SupplierForm = ({
|
||||
account_number: initialValues?.account_number ?? '',
|
||||
due_date: initialValues?.due_date ?? 1,
|
||||
};
|
||||
}, [initialValues]);
|
||||
}, [initialValues, typeOptions, categoryOptions]);
|
||||
|
||||
// Formik
|
||||
const formik = useFormik<SupplierFormValues>({
|
||||
@@ -260,7 +256,6 @@ const SupplierForm = ({
|
||||
}
|
||||
onChange={typeChangeHandler}
|
||||
options={typeOptions}
|
||||
onInputChange={setTypeSelectInputValue}
|
||||
isError={formik.touched.type && Boolean(formik.errors.type)}
|
||||
errorMessage={formik.errors.type as string}
|
||||
isDisabled={formType === 'detail'}
|
||||
@@ -278,7 +273,6 @@ const SupplierForm = ({
|
||||
}
|
||||
onChange={categoryChangeHandler}
|
||||
options={categoryOptions}
|
||||
onInputChange={setCategorySelectInputValue}
|
||||
isError={
|
||||
formik.touched.category && Boolean(formik.errors.category)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user