mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 21:00:31 +00:00
-- amend
This commit is contained in:
@@ -26,7 +26,7 @@ import AppToaster from 'components/AppToaster';
|
||||
import Dragzone from 'components/Dragzone';
|
||||
|
||||
import useMedia from 'hooks/useMedia';
|
||||
import { compose } from 'utils';
|
||||
import { compose, repeatValue } from 'utils';
|
||||
|
||||
function ExpenseForm({
|
||||
// #withMedia
|
||||
@@ -135,10 +135,7 @@ function ExpenseForm({
|
||||
reference_no: '',
|
||||
currency_code: '',
|
||||
categories: [
|
||||
defaultCategory,
|
||||
defaultCategory,
|
||||
defaultCategory,
|
||||
defaultCategory,
|
||||
...repeatValue(defaultCategory, 4),
|
||||
],
|
||||
}),
|
||||
[defaultCategory],
|
||||
@@ -267,7 +264,7 @@ function ExpenseForm({
|
||||
const handleSubmitClick = useCallback(
|
||||
(payload) => {
|
||||
setPayload(payload);
|
||||
formik.resetForm();
|
||||
formik.submitForm();
|
||||
},
|
||||
[setPayload, formik],
|
||||
);
|
||||
@@ -301,7 +298,9 @@ function ExpenseForm({
|
||||
const handleClearAllLines = () => {
|
||||
formik.setFieldValue(
|
||||
'categories',
|
||||
orderingCategoriesIndex([defaultCategory, defaultCategory, defaultCategory, defaultCategory]),
|
||||
orderingCategoriesIndex([
|
||||
...repeatValue(defaultCategory, 4),
|
||||
]),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user