diff --git a/src/pages/master/sucos/hooks/ManageSucosContext.tsx b/src/pages/master/sucos/hooks/ManageSucosContext.tsx index 81e38a6..6a888b1 100644 --- a/src/pages/master/sucos/hooks/ManageSucosContext.tsx +++ b/src/pages/master/sucos/hooks/ManageSucosContext.tsx @@ -153,7 +153,7 @@ const ManageSucosContextProvider = ({ children }: { children: React.ReactNode }) const response = await GetData(`${API_URL}/sucos/list`, { limit: limit, page: page + 1, - with_deleted: true, + with_deleted: false, order_field: sorting[0].id, order_direction: sorting[0].desc == false ? 'ASC' : 'DESC', filter: JSON.stringify(filter) diff --git a/src/pages/master/wallet/blocks/EditDialog.tsx b/src/pages/master/wallet/blocks/EditDialog.tsx index c5faae1..16bebcb 100644 --- a/src/pages/master/wallet/blocks/EditDialog.tsx +++ b/src/pages/master/wallet/blocks/EditDialog.tsx @@ -53,13 +53,11 @@ const EditDialog = () => { description: string; status: string; group: string[]; - currency_id: string; } = { name: '', description: '', status: '', - group: [], - currency_id: '' + group: [] }; const [formField, setFormField] = useState(initialState); const [currencies, setCurrencies] = useState([]); @@ -71,12 +69,12 @@ const EditDialog = () => { }; const doUpdateWallet = useCallback( - async (e: React.FormEvent) => { - e.preventDefault(); + async (payload: { name: string; description: string; status: string }) => { + // e.preventDefault(); const response = await PutData( `${API_URL_MASTER_DATA}/wallet/update/${selectedWallet?.Wallet_id}`, - formField + payload ); if (response?.status) { @@ -94,8 +92,14 @@ const EditDialog = () => { const handleSubmit = (e: React.FormEvent) => { e.preventDefault(); - console.log(formField); - doUpdateWallet(e); + // const { name, description, status } = formField; + const payload = { + name: formField.name, + description: formField.description, + status: formField.status + }; + // console.log(payload); + doUpdateWallet(payload); setAlert({ show: false, message: '' }); }; @@ -156,8 +160,6 @@ const EditDialog = () => { .map((g) => g.name) .join(', '); - const selectedCurrency = currencies.find((currency) => currency.ID === formField.currency_id); - useEffect(() => { getCurrencyLists([{ id: 'name', desc: false }]); getGroupLists([{ id: 'name', desc: false }]); @@ -182,7 +184,7 @@ const EditDialog = () => { resetForm(); } }, [showEditDialog]); - // console.log(selectedWallet); + return ( handleEditDialog(open, null)}> @@ -246,17 +248,10 @@ const EditDialog = () => { -
-
- - -
-
-
- +
@@ -264,7 +259,9 @@ const EditDialog = () => { - +