cli: return the correct data type for enum attributes
authorFelix Fietkau <[email protected]>
Tue, 20 May 2025 18:52:01 +0000 (20:52 +0200)
committerFelix Fietkau <[email protected]>
Sat, 31 May 2025 14:23:47 +0000 (16:23 +0200)
Return entries from the value array instead of the provided string

Signed-off-by: Felix Fietkau <[email protected]>
package/utils/cli/files/usr/share/ucode/cli/types.uc

index def3b12d91933a1d64c3ba51b9ed703b4cfe6b0f..10b004d1ad0bdf53f4201e104200d8a18eb65419 100644 (file)
@@ -70,8 +70,7 @@ const types = {
                                val = lc(val);
                                val = filter(list, (v) => val == lc(v))[0];
                        } else {
-                               if (index(list, val) < 0)
-                                       val = null;
+                               val = filter(list, (v) => val == v)[0];
                        }
 
                        if (val == null)