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
) => makeColumn(title, dataIndex, {
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
})

View File

@ -40,7 +40,7 @@ export const ClusterController = () => {
useEffect(() => invokeWebApiWrapperAsync(
async () => {
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 ?? [])
},
setShowLoader,

View File

@ -55,7 +55,7 @@ export const UserController = () => {
useEffect(() => invokeWebApiWrapperAsync(
async () => {
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 ?? [])
},
setShowLoader,

View File

@ -40,7 +40,7 @@ export const WellController = () => {
useEffect(() => invokeWebApiWrapperAsync(
async () => {
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 ?? [])
},
setShowLoader,