feat(richtext-lexical)!: link node: change doc data format to be consistent with relationship field (#4504)
BREAKING: An unpopulated, internal link node no longer saves the doc id under fields.doc.value.id. Now, it saves it under fields.doc.value. Migration inside of payload is automatic. If you are reading from the link node inside of your frontend, though, you will have to adjust it. The version property of the link and autoLink node has been changed from 1 to 2.
This commit is contained in:
@@ -54,7 +54,7 @@ export function generateLexicalRichText() {
|
||||
format: '',
|
||||
indent: 0,
|
||||
type: 'link',
|
||||
version: 1,
|
||||
version: 2,
|
||||
fields: {
|
||||
url: 'https://payloadcms.com',
|
||||
newTab: true,
|
||||
@@ -86,13 +86,11 @@ export function generateLexicalRichText() {
|
||||
format: '',
|
||||
indent: 0,
|
||||
type: 'link',
|
||||
version: 1,
|
||||
version: 2,
|
||||
fields: {
|
||||
url: 'https://',
|
||||
doc: {
|
||||
value: {
|
||||
id: '{{ARRAY_DOC_ID}}',
|
||||
},
|
||||
value: '{{ARRAY_DOC_ID}}',
|
||||
relationTo: 'array-fields',
|
||||
},
|
||||
newTab: false,
|
||||
|
||||
Reference in New Issue
Block a user