From be7b3fa458e8e4fec4b9809f795999231f02f14e Mon Sep 17 00:00:00 2001 From: Wikzyy Date: Fri, 21 Mar 2025 15:22:44 +0700 Subject: [PATCH] fix define row to match with response --- src/pages/master/provider/blocks/EditDialog.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/pages/master/provider/blocks/EditDialog.tsx b/src/pages/master/provider/blocks/EditDialog.tsx index e7c55d0..93b487e 100644 --- a/src/pages/master/provider/blocks/EditDialog.tsx +++ b/src/pages/master/provider/blocks/EditDialog.tsx @@ -56,7 +56,7 @@ const EditDialog = () => { type: '', status: '', transactionTypeId: '', - agentId: '', + agent: '', updated_by: '', updated_at: '' }; @@ -128,7 +128,7 @@ const EditDialog = () => { const doFetchData = useCallback(async (id: string) => { const response = await GetData(`${API_URL_MASTERDATA}/provider/getdata/${id}`, { id }); - + console.log(response); if (response?.status) { setFormField((prev) => ({ ...prev, @@ -137,7 +137,7 @@ const EditDialog = () => { type: response?.data.type, status: response?.data.status, transactionTypeId: response?.data.transactionTypeId, - agentId: response?.data.agentId + agent: response?.data.agent })); } }, []); @@ -151,7 +151,7 @@ const EditDialog = () => { formField.type.trim() === '' || formField.status.trim() === '' || formField.transactionTypeId.trim() === '' || - formField.agentId.trim() === '' + formField.agent.trim() === '' ) { setAlert({ show: true, message: 'Please fill in all required fields.' }); return; @@ -309,7 +309,7 @@ const EditDialog = () => { @@ -326,7 +326,7 @@ const EditDialog = () => { onSelect={() => { setFormField({ ...formField, - agentId: customer.msisdn + agent: customer.msisdn }); setOpen(false); }}