feat: create custom object and update edited object names (#2220)
Closes #2155, Closes #2153
This commit is contained in:
@ -0,0 +1,18 @@
|
||||
import toCamelCase from 'lodash.camelcase';
|
||||
import upperFirst from 'lodash.upperfirst';
|
||||
|
||||
import { MetadataObject } from '../types/MetadataObject';
|
||||
|
||||
export const formatMetadataObjectInput = (
|
||||
input: Pick<
|
||||
MetadataObject,
|
||||
'labelPlural' | 'labelSingular' | 'icon' | 'description'
|
||||
>,
|
||||
) => ({
|
||||
description: input.description?.trim() ?? null,
|
||||
icon: input.icon,
|
||||
labelPlural: input.labelPlural.trim(),
|
||||
labelSingular: input.labelSingular.trim(),
|
||||
namePlural: upperFirst(toCamelCase(input.labelPlural.trim())),
|
||||
nameSingular: upperFirst(toCamelCase(input.labelSingular.trim())),
|
||||
});
|
||||
Reference in New Issue
Block a user