fix table and field agent on formField

- show Host to Host
- set field agent to optional with default value `''`
This commit is contained in:
Wikzyy
2025-04-08 16:11:00 +07:00
parent 3fe0eb8ffc
commit b60f1ac73a
2 changed files with 8 additions and 2 deletions

View File

@ -145,7 +145,7 @@ const EditDialog = () => {
type: response?.data.type,
status: response?.data.status,
transaction_type: response?.data.transaction_type.id,
agent: response?.data.agent.id
agent: response?.data.agent?.id || ''
}));
}
}, []);

View File

@ -94,7 +94,13 @@ const ManageProviderContextProvider = ({ children }: { children: React.ReactNode
}
},
{
accessorFn: (row) => row.provider_type,
accessorFn: (row) => {
const typeMapping: Record<string, string> = {
h2h: 'Host To Host',
agent: 'Agent'
};
return typeMapping[row.provider_type] || row.provider_type;
},
id: 'type',
header: ({ column }) => <DataGridColumnHeader title="Type" column={column} />,
enableSorting: false,