From 68deba4b7b951a2d3d0c9e3cb30ddc9f6386c69c Mon Sep 17 00:00:00 2001 From: elforjani3 Date: Mon, 15 Feb 2021 15:25:55 +0200 Subject: [PATCH 1/3] fix: Disable item type inventory in edit mode --- client/src/containers/Items/ItemFormPrimarySection.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/src/containers/Items/ItemFormPrimarySection.js b/client/src/containers/Items/ItemFormPrimarySection.js index 621609ea8..531683b7c 100644 --- a/client/src/containers/Items/ItemFormPrimarySection.js +++ b/client/src/containers/Items/ItemFormPrimarySection.js @@ -31,7 +31,7 @@ export default function ItemFormPrimarySection() { const nameFieldRef = useRef(null); // Formik context. - const { values: { itemType } } = useFormikContext(); + const { values: { type } } = useFormikContext(); useEffect(() => { // Auto focus item name field once component mount. @@ -87,7 +87,7 @@ export default function ItemFormPrimarySection() { form.setFieldValue('type', _value); })} selectedValue={value} - disabled={itemType === 'inventory'} + disabled={type === 'inventory'} > } value="service" /> } value="non-inventory" /> From e192e9e4ac96d5c20e0d8bef471ecf25ec754b46 Mon Sep 17 00:00:00 2001 From: elforjani3 Date: Mon, 15 Feb 2021 15:51:07 +0200 Subject: [PATCH 2/3] fix:disable financial detail in edit mode. --- client/src/containers/Vendors/VendorForm/VendorFormProvider.js | 1 + 1 file changed, 1 insertion(+) diff --git a/client/src/containers/Vendors/VendorForm/VendorFormProvider.js b/client/src/containers/Vendors/VendorForm/VendorFormProvider.js index 3c55e118e..e559846b9 100644 --- a/client/src/containers/Vendors/VendorForm/VendorFormProvider.js +++ b/client/src/containers/Vendors/VendorForm/VendorFormProvider.js @@ -29,6 +29,7 @@ function VendorFormProvider({ vendorId, ...props }) { const [submitPayload, setSubmitPayload] = useState({}); const provider = { + vendorId, currencies, vendor, submitPayload, From 8e29f20bf3b82b68d3490f688d3b79b8d69e3c98 Mon Sep 17 00:00:00 2001 From: elforjani3 Date: Mon, 15 Feb 2021 16:33:22 +0200 Subject: [PATCH 3/3] fix: Edit Account. --- client/src/hooks/query/accounts.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/hooks/query/accounts.js b/client/src/hooks/query/accounts.js index afaa01b7c..d0b69e6c0 100644 --- a/client/src/hooks/query/accounts.js +++ b/client/src/hooks/query/accounts.js @@ -82,7 +82,7 @@ export function useEditAccount(props) { const query = useQueryClient(); return useMutation( - ([values, id]) => ApiService.post(`accounts/${id}`, values), + ([id,values]) => ApiService.post(`accounts/${id}`, values), { onSuccess: () => { query.invalidateQueries('ACCOUNTS');