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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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