feat: save edited custom field (#2245)
Closes #2161 Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
This commit is contained in:
@ -1,16 +1,12 @@
|
||||
import toCamelCase from 'lodash.camelcase';
|
||||
|
||||
import { MetadataFieldDataType } from '@/settings/data-model/types/ObjectFieldDataType';
|
||||
import { Field } from '~/generated-metadata/graphql';
|
||||
|
||||
export const formatMetadataFieldInput = (
|
||||
input: Pick<Field, 'label' | 'icon' | 'description'> & {
|
||||
type: MetadataFieldDataType;
|
||||
},
|
||||
input: Pick<Field, 'label' | 'icon' | 'description'>,
|
||||
) => ({
|
||||
description: input.description?.trim() ?? null,
|
||||
icon: input.icon,
|
||||
label: input.label.trim(),
|
||||
name: toCamelCase(input.label.trim()),
|
||||
type: input.type,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user