key заменено на value

This commit is contained in:
goodmice 2021-12-02 15:46:47 +05:00
parent 7a3d26e846
commit 58cc1dc714
4 changed files with 4 additions and 4 deletions

View File

@ -209,7 +209,7 @@ export const makeSelectColumn = <T extends unknown = string>(
other?: columnPropsOther other?: columnPropsOther
) => makeColumn(title, dataIndex, { ) => makeColumn(title, dataIndex, {
input: <Select options={options}/>, input: <Select options={options}/>,
render: (key) => options.find(option => option?.key === key)?.label ?? defaultValue ?? '--', render: (value) => options.find(option => option?.value === value)?.label ?? defaultValue ?? '--',
...other ...other
}) })

View File

@ -40,7 +40,7 @@ export const ClusterController = () => {
useEffect(() => invokeWebApiWrapperAsync( useEffect(() => invokeWebApiWrapperAsync(
async () => { async () => {
let deposits = await DepositService.getDeposits() let deposits = await DepositService.getDeposits()
deposits = deposits?.map((deposit) => ({ key: deposit.id, label: deposit.caption })) deposits = deposits?.map((deposit) => ({ value: deposit.id, label: deposit.caption }))
setDeposits(deposits ?? []) setDeposits(deposits ?? [])
}, },
setShowLoader, setShowLoader,

View File

@ -55,7 +55,7 @@ export const UserController = () => {
useEffect(() => invokeWebApiWrapperAsync( useEffect(() => invokeWebApiWrapperAsync(
async () => { async () => {
let companies = await AdminCompanyService.getPage(0, maxCompaniesCount) let companies = await AdminCompanyService.getPage(0, maxCompaniesCount)
companies = companies?.map((company) => ({ key: company.id, label: company.caption })) companies = companies?.map((company) => ({ value: company.id, label: company.caption }))
setCompanies(companies?.items ?? []) setCompanies(companies?.items ?? [])
}, },
setShowLoader, setShowLoader,

View File

@ -40,7 +40,7 @@ export const WellController = () => {
useEffect(() => invokeWebApiWrapperAsync( useEffect(() => invokeWebApiWrapperAsync(
async () => { async () => {
let clusters = await ClusterService.getClusters() let clusters = await ClusterService.getClusters()
clusters = clusters?.map((cluster) => ({ key: cluster.id, label: cluster.caption })) clusters = clusters?.map((cluster) => ({ value: cluster.id, label: cluster.caption }))
setClusters(clusters ?? []) setClusters(clusters ?? [])
}, },
setShowLoader, setShowLoader,