|
@@ -130,9 +130,6 @@ export const GoodForm = ({
|
|
|
formik.setFieldValue("description", good.description || "");
|
|
|
formik.setFieldValue("amount", good.amount || 0);
|
|
|
formik.setFieldValue("price", good.price || 0);
|
|
|
-
|
|
|
- formik.setTouched({ ...formik.touched, ...{ amount: true, description: true, name: true, price: true } });
|
|
|
- formik.validateForm();
|
|
|
}, [good.categories, good.name, good.description, good.amount, good.price]);
|
|
|
|
|
|
useEffect(() => {
|
|
@@ -234,17 +231,12 @@ export const GoodForm = ({
|
|
|
<Button variant="contained" onClick={() => setIsDeleteModalOpen(true)} disabled={formik.isSubmitting} color="error">
|
|
|
Видалити
|
|
|
</Button>
|
|
|
- <Button
|
|
|
- variant="contained"
|
|
|
- onClick={() => setIsNew(true)}
|
|
|
- disabled={!formik.isValid || formik.isSubmitting}
|
|
|
- type="submit"
|
|
|
- >
|
|
|
+ <Button variant="contained" onClick={() => setIsNew(true)} disabled={formik.isSubmitting} type="submit">
|
|
|
Зберегти як новий
|
|
|
</Button>
|
|
|
</>
|
|
|
)}
|
|
|
- <Button variant="contained" onClick={() => setIsNew(false)} disabled={!formik.isValid || formik.isSubmitting} type="submit">
|
|
|
+ <Button variant="contained" onClick={() => setIsNew(false)} disabled={formik.isSubmitting} type="submit">
|
|
|
Зберегти
|
|
|
</Button>
|
|
|
</Stack>
|