2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-04-28 11:36:44 +00:00

[PUI] Fix choice-based settings showing as string fields (#7543)

This commit is contained in:
Lavissa 2024-07-02 02:25:22 +02:00 committed by GitHub
parent ee97f0859d
commit da9ab4a64f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -49,12 +49,12 @@ export function SettingList({
// Determine the field type of the setting // Determine the field type of the setting
const fieldType = useMemo(() => { const fieldType = useMemo(() => {
if (setting?.type != undefined) { if (setting?.choices?.length) {
return setting.type; return 'choice';
} }
if (setting?.choices != undefined && setting.choices.length > 0) { if (setting?.type != undefined) {
return 'choice'; return setting.type;
} }
return 'string'; return 'string';