Untitled

mail@pastecode.io avatar
unknown
typescript
a month ago
1.1 kB
4
Indexable
Never
export type PhoneBaseModel = {
  phone: string;
  fullPhone: string;
  isoCode: string;
  country: string;
  dialCode: string;
  formattedValue: string;
  floatValue: number;
};

schema = {
    type: 'object',
    properties: {
      phone: {
        type: 'object',
        properties: {
          phone: {
            type: 'string',
          },
          fullPhone: {
            type: 'string',
            format: 'fullPhone',
          },
          isoCode: {
            type: 'string',
          },
          country: {
            type: 'string',
          },
          dialCode: {
            type: 'string',
          },
          formattedValue: {
            type: 'string',
          },
          floatValue: {
            type: 'number',
          },
        },
        uniforms: {
          component: PhoneField,
          label: '',
          placeholder: '(___) ___ - ____',
        },
        required: ['phone', 'isoCode', 'fullPhone'],
        errorMessage: 'A valid phone is required',
      },
    },
    required: ['phone'],
  },
Leave a Comment