Fix new field type enums in parseFieldType (#2361)

* Fix new field type enums in parseFieldType

* Fix with GraphQL enum
This commit is contained in:
Lucas Bordeau
2023-11-06 17:24:47 +01:00
committed by GitHub
parent 88ca846f83
commit b98d474308

View File

@@ -1,11 +1,12 @@
import { FieldType } from '@/ui/object/field/types/FieldType'; import { FieldType } from '@/ui/object/field/types/FieldType';
import { FieldMetadataType } from '~/generated-metadata/graphql';
export const parseFieldType = (fieldType: string): FieldType => { export const parseFieldType = (fieldType: FieldMetadataType): FieldType => {
if (fieldType === 'url') { if (fieldType === FieldMetadataType.Url) {
return 'URL_V2'; return 'URL_V2';
} }
if (fieldType === 'money') { if (fieldType === FieldMetadataType.Money) {
return 'MONEY_AMOUNT_V2'; return 'MONEY_AMOUNT_V2';
} }