|
@@ -130,9 +130,6 @@ export const GoodForm = ({
|
|
formik.setFieldValue("description", good.description || "");
|
|
formik.setFieldValue("description", good.description || "");
|
|
formik.setFieldValue("amount", good.amount || 0);
|
|
formik.setFieldValue("amount", good.amount || 0);
|
|
formik.setFieldValue("price", good.price || 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]);
|
|
}, [good.categories, good.name, good.description, good.amount, good.price]);
|
|
|
|
|
|
useEffect(() => {
|
|
useEffect(() => {
|
|
@@ -234,17 +231,12 @@ export const GoodForm = ({
|
|
<Button variant="contained" onClick={() => setIsDeleteModalOpen(true)} disabled={formik.isSubmitting} color="error">
|
|
<Button variant="contained" onClick={() => setIsDeleteModalOpen(true)} disabled={formik.isSubmitting} color="error">
|
|
Видалити
|
|
Видалити
|
|
</Button>
|
|
</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>
|
|
</>
|
|
</>
|
|
)}
|
|
)}
|
|
- <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>
|
|
</Button>
|
|
</Stack>
|
|
</Stack>
|