From b98d474308daec01bc0742c76b3030b70b22d99c Mon Sep 17 00:00:00 2001 From: Lucas Bordeau Date: Mon, 6 Nov 2023 17:24:47 +0100 Subject: [PATCH] Fix new field type enums in parseFieldType (#2361) * Fix new field type enums in parseFieldType * Fix with GraphQL enum --- front/src/modules/metadata/utils/parseFieldType.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/front/src/modules/metadata/utils/parseFieldType.ts b/front/src/modules/metadata/utils/parseFieldType.ts index f50c3038e..3015d4245 100644 --- a/front/src/modules/metadata/utils/parseFieldType.ts +++ b/front/src/modules/metadata/utils/parseFieldType.ts @@ -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'; }