fix(client): fix field names of variable input (#5128)

This commit is contained in:
Junyi 2024-08-26 15:43:26 +08:00 committed by GitHub
parent ffcc60cadf
commit eaf23766c7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -132,14 +132,14 @@ function getTypedConstantOption(type: string, types: UseTypeConstantType, fieldN
) )
: allTypes : allTypes
).map((item) => ).map((item) =>
Object.keys(item).reduce( Object.keys(fieldNames).reduce(
(result, key) => (result, key) =>
fieldNames[key] in item key in item
? Object.assign(result, { ? Object.assign(result, {
[fieldNames[key]]: item[key], [fieldNames[key]]: item[key],
}) })
: result, : result,
item, { ...item },
), ),
); );
return { return {