Allow empty string for primary link (#11171)
Fixes https://github.com/twentyhq/twenty/issues/11166 https://github.com/user-attachments/assets/72208ac9-c19d-4c19-b305-40d6318310ed
This commit is contained in:
@ -3,9 +3,9 @@ import { LinksFieldMenuItem } from '@/object-record/record-field/meta-types/inpu
|
||||
import { recordFieldInputIsFieldInErrorComponentState } from '@/object-record/record-field/states/recordFieldInputIsFieldInErrorComponentState';
|
||||
import { useSetRecoilComponentStateV2 } from '@/ui/utilities/state/component-state/hooks/useSetRecoilComponentStateV2';
|
||||
import { useMemo } from 'react';
|
||||
import { absoluteUrlSchema, isDefined } from 'twenty-shared/utils';
|
||||
import { FieldMetadataType } from '~/generated-metadata/graphql';
|
||||
import { MultiItemFieldInput } from './MultiItemFieldInput';
|
||||
import { absoluteUrlSchema, isDefined } from 'twenty-shared/utils';
|
||||
|
||||
type LinksFieldInputProps = {
|
||||
onCancel?: () => void;
|
||||
|
||||
@ -1,10 +1,10 @@
|
||||
import { absoluteUrlSchema } from 'twenty-shared/utils';
|
||||
import { z } from 'zod';
|
||||
import { FieldLinksValue } from '../FieldMetadata';
|
||||
import { absoluteUrlSchema } from 'twenty-shared/utils';
|
||||
|
||||
export const linksSchema = z.object({
|
||||
primaryLinkLabel: z.string(),
|
||||
primaryLinkUrl: absoluteUrlSchema,
|
||||
primaryLinkUrl: absoluteUrlSchema.or(z.string().length(0)),
|
||||
secondaryLinks: z
|
||||
.array(z.object({ label: z.string(), url: absoluteUrlSchema }))
|
||||
.nullable(),
|
||||
|
||||
Reference in New Issue
Block a user