Sort types

This commit is contained in:
Adria Navarro 2024-04-17 16:43:13 +02:00
parent ae137ca677
commit 7c3c82013c
1 changed files with 8 additions and 3 deletions

View File

@ -363,9 +363,14 @@
function getAllowedTypes() {
if (originalName) {
return (SWITCHABLE_TYPES[field.type] || [editableColumn.type]).map(
f => FIELDS[f.toUpperCase()]
)
const possibleTypes = (
SWITCHABLE_TYPES[field.type] || [editableColumn.type]
).map(t => t.toLowerCase())
return Object.entries(FIELDS)
.filter(([fieldType]) =>
possibleTypes.includes(fieldType.toLowerCase())
)
.map(([_, fieldDefinition]) => fieldDefinition)
}
const isUsers =