mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-22 22:23:07 +00:00
fix type isssues
This commit is contained in:
parent
a2ad8f7e20
commit
046f8a539f
4 changed files with 23 additions and 3 deletions
|
|
@ -25,6 +25,7 @@ export const submitWhatsapp = async (input: WhatsAppFormInput) => {
|
||||||
collection: 'subscription',
|
collection: 'subscription',
|
||||||
data: {
|
data: {
|
||||||
contact: contact.id,
|
contact: contact.id,
|
||||||
|
consent: 2,
|
||||||
comment,
|
comment,
|
||||||
},
|
},
|
||||||
req: { transactionID },
|
req: { transactionID },
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ export const Consent: CollectionConfig = {
|
||||||
fields: [
|
fields: [
|
||||||
{
|
{
|
||||||
name: 'text',
|
name: 'text',
|
||||||
type: 'text',
|
type: 'richText',
|
||||||
label: 'Texto',
|
label: 'Texto',
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@ import { PhoneInput } from './PhoneInput'
|
||||||
import { StateSelect } from './StateSelect'
|
import { StateSelect } from './StateSelect'
|
||||||
import { CitySelect } from './CitySelect'
|
import { CitySelect } from './CitySelect'
|
||||||
import { PostalCodeInput } from './PostalCodeInput'
|
import { PostalCodeInput } from './PostalCodeInput'
|
||||||
|
import { convertLexicalToHTML } from '@payloadcms/richtext-lexical/html'
|
||||||
|
|
||||||
interface PetitionFormProps {
|
interface PetitionFormProps {
|
||||||
id: string
|
id: string
|
||||||
|
|
@ -105,7 +106,11 @@ export const PetitionForm = ({ id, petition }: PetitionFormProps) => {
|
||||||
</Field>
|
</Field>
|
||||||
<Field>
|
<Field>
|
||||||
{typeof petition.form.consent !== 'number' ? (
|
{typeof petition.form.consent !== 'number' ? (
|
||||||
<FieldDescription>{petition.form.consent.text}</FieldDescription>
|
<FieldDescription
|
||||||
|
dangerouslySetInnerHTML={{
|
||||||
|
__html: convertLexicalToHTML({ data: petition.form.consent.text }),
|
||||||
|
}}
|
||||||
|
/>
|
||||||
) : null}
|
) : null}
|
||||||
{methods.formState.errors.root?.message ? (
|
{methods.formState.errors.root?.message ? (
|
||||||
<FieldDescription className="text-destructive">
|
<FieldDescription className="text-destructive">
|
||||||
|
|
|
||||||
|
|
@ -229,7 +229,21 @@ export interface Petition {
|
||||||
*/
|
*/
|
||||||
export interface Consent {
|
export interface Consent {
|
||||||
id: number;
|
id: number;
|
||||||
text: string;
|
text: {
|
||||||
|
root: {
|
||||||
|
type: string;
|
||||||
|
children: {
|
||||||
|
type: any;
|
||||||
|
version: number;
|
||||||
|
[k: string]: unknown;
|
||||||
|
}[];
|
||||||
|
direction: ('ltr' | 'rtl') | null;
|
||||||
|
format: 'left' | 'start' | 'center' | 'right' | 'end' | 'justify' | '';
|
||||||
|
indent: number;
|
||||||
|
version: number;
|
||||||
|
};
|
||||||
|
[k: string]: unknown;
|
||||||
|
};
|
||||||
updatedAt: string;
|
updatedAt: string;
|
||||||
createdAt: string;
|
createdAt: string;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue