enumOptions and enum reader used everywhere
This commit is contained in:
@@ -8,8 +8,8 @@ export function resolveTemplate(template: string, item: any): string {
|
||||
}
|
||||
|
||||
export function getFieldOptions(field: ResourceField, relationData?: any[]): SelectOption[] {
|
||||
if (field.type === 'enum' && field.options) {
|
||||
return field.options.map(opt => ({
|
||||
if (field.type === 'enum') {
|
||||
return (field.options ?? []).map(opt => ({
|
||||
key: opt,
|
||||
value: field.enumLabels?.[opt] ?? opt,
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user