Move capitalize into twenty-shared (#9414)
capitalize had been moved into twenty-shared. Let's remove the duplicates in server and front !
This commit is contained in:
@ -10,7 +10,7 @@ import { getRecordNodeFromRecord } from '@/object-record/cache/utils/getRecordNo
|
||||
import { generateDepthOneRecordGqlFields } from '@/object-record/graphql/utils/generateDepthOneRecordGqlFields';
|
||||
import { ObjectRecord } from '@/object-record/types/ObjectRecord';
|
||||
import { prefillRecord } from '@/object-record/utils/prefillRecord';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
|
||||
export const useCreateOneRecordInCache = <T extends ObjectRecord>({
|
||||
objectMetadataItem,
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { getObjectTypename } from '@/object-record/cache/utils/getObjectTypename';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
|
||||
export const getConnectionTypename = (objectNameSingular: string) => {
|
||||
return `${capitalize(getObjectTypename(objectNameSingular))}Connection`;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { getObjectTypename } from '@/object-record/cache/utils/getObjectTypename';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
|
||||
export const getEdgeTypename = (objectNameSingular: string) => {
|
||||
return `${capitalize(getObjectTypename(objectNameSingular))}Edge`;
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { getObjectTypename } from '@/object-record/cache/utils/getObjectTypename';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
|
||||
export const getNodeTypename = (objectNameSingular: string) => {
|
||||
return capitalize(getObjectTypename(objectNameSingular));
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
|
||||
export const getObjectTypename = (objectNameSingular: string) => {
|
||||
return capitalize(objectNameSingular);
|
||||
|
||||
@ -6,8 +6,8 @@ import { getRecordFromRecordNode } from '@/object-record/cache/utils/getRecordFr
|
||||
import { RecordGqlFields } from '@/object-record/graphql/types/RecordGqlFields';
|
||||
import { generateDepthOneRecordGqlFields } from '@/object-record/graphql/utils/generateDepthOneRecordGqlFields';
|
||||
import { ObjectRecord } from '@/object-record/types/ObjectRecord';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
import { isUndefinedOrNull } from '~/utils/isUndefinedOrNull';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
|
||||
export const getRecordFromCache = <T extends ObjectRecord = ObjectRecord>({
|
||||
objectMetadataItem,
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { z } from 'zod';
|
||||
|
||||
import { RecordGqlConnection } from '@/object-record/graphql/types/RecordGqlConnection';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
|
||||
export const isObjectRecordConnection = (
|
||||
objectNameSingular: string,
|
||||
|
||||
@ -2,7 +2,7 @@ import { StoreValue } from '@apollo/client';
|
||||
import { z } from 'zod';
|
||||
|
||||
import { RecordGqlRefConnection } from '@/object-record/cache/types/RecordGqlRefConnection';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
|
||||
export const isObjectRecordConnectionWithRefs = (
|
||||
objectNameSingular: string,
|
||||
|
||||
@ -2,8 +2,8 @@ import { ApolloCache, Modifiers } from '@apollo/client/cache';
|
||||
|
||||
import { ObjectMetadataItem } from '@/object-metadata/types/ObjectMetadataItem';
|
||||
import { ObjectRecord } from '@/object-record/types/ObjectRecord';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
import { isUndefinedOrNull } from '~/utils/isUndefinedOrNull';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
|
||||
export const modifyRecordFromCache = <
|
||||
CachedObjectRecord extends ObjectRecord = ObjectRecord,
|
||||
|
||||
@ -6,8 +6,8 @@ import { mapObjectMetadataToGraphQLQuery } from '@/object-metadata/utils/mapObje
|
||||
import { getRecordNodeFromRecord } from '@/object-record/cache/utils/getRecordNodeFromRecord';
|
||||
import { RecordGqlNode } from '@/object-record/graphql/types/RecordGqlNode';
|
||||
import { ObjectRecord } from '@/object-record/types/ObjectRecord';
|
||||
import { capitalize } from 'twenty-shared';
|
||||
import { isUndefinedOrNull } from '~/utils/isUndefinedOrNull';
|
||||
import { capitalize } from '~/utils/string/capitalize';
|
||||
|
||||
export const updateRecordFromCache = <T extends ObjectRecord>({
|
||||
objectMetadataItems,
|
||||
|
||||
Reference in New Issue
Block a user