Import - richTextV2 import (#12868)

- Enable markdown import
- Decrease the createMany batch size on import
This commit is contained in:
Etienne
2025-06-26 17:02:45 +02:00
committed by GitHub
parent 658cd46336
commit ada7933f9b
5 changed files with 8 additions and 6 deletions

View File

@ -99,13 +99,13 @@ export class RecordInputTransformerService {
let convertedMarkdown: string | null = null;
try {
convertedMarkdown = parsedValue.blocknote
convertedMarkdown = isDefined(parsedValue.blocknote)
? await serverBlockNoteEditor.blocksToMarkdownLossy(
JSON.parse(parsedValue.blocknote),
)
: null;
} catch {
convertedMarkdown = parsedValue.blocknote;
convertedMarkdown = parsedValue.blocknote || null;
}
const convertedBlocknote = parsedValue.markdown

View File

@ -1,5 +1,5 @@
import { z } from 'zod';
import { FieldMetadataType } from 'twenty-shared/types';
import { z } from 'zod';
import { CompositeType } from 'src/engine/metadata-modules/field-metadata/interfaces/composite-type.interface';
@ -21,8 +21,9 @@ export const richTextV2CompositeType: CompositeType = {
],
};
// with import only markdown subfield is filled, then blocknote is undefined
export const richTextV2ValueSchema = z.object({
blocknote: z.string().nullable(),
blocknote: z.string().nullable().optional(),
markdown: z.string().nullable(),
});