mirror of
https://github.com/fsolla/teqo.git
synced 2026-11-13 15:13: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',
|
||||
data: {
|
||||
contact: contact.id,
|
||||
consent: 2,
|
||||
comment,
|
||||
},
|
||||
req: { transactionID },
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ export const Consent: CollectionConfig = {
|
|||
fields: [
|
||||
{
|
||||
name: 'text',
|
||||
type: 'text',
|
||||
type: 'richText',
|
||||
label: 'Texto',
|
||||
required: true,
|
||||
},
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ import { PhoneInput } from './PhoneInput'
|
|||
import { StateSelect } from './StateSelect'
|
||||
import { CitySelect } from './CitySelect'
|
||||
import { PostalCodeInput } from './PostalCodeInput'
|
||||
import { convertLexicalToHTML } from '@payloadcms/richtext-lexical/html'
|
||||
|
||||
interface PetitionFormProps {
|
||||
id: string
|
||||
|
|
@ -105,7 +106,11 @@ export const PetitionForm = ({ id, petition }: PetitionFormProps) => {
|
|||
</Field>
|
||||
<Field>
|
||||
{typeof petition.form.consent !== 'number' ? (
|
||||
<FieldDescription>{petition.form.consent.text}</FieldDescription>
|
||||
<FieldDescription
|
||||
dangerouslySetInnerHTML={{
|
||||
__html: convertLexicalToHTML({ data: petition.form.consent.text }),
|
||||
}}
|
||||
/>
|
||||
) : null}
|
||||
{methods.formState.errors.root?.message ? (
|
||||
<FieldDescription className="text-destructive">
|
||||
|
|
|
|||
|
|
@ -229,7 +229,21 @@ export interface Petition {
|
|||
*/
|
||||
export interface Consent {
|
||||
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;
|
||||
createdAt: string;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue