fix(richtext-lexical): html converters can populate relationships infinitely (#7890)
Fixes https://github.com/payloadcms/payload/issues/7743
This commit is contained in:
@@ -115,11 +115,18 @@ export type FieldHookArgs<TData extends TypeWithID = any, TValue = any, TSibling
|
||||
/** The collection which the field belongs to. If the field belongs to a global, this will be null. */
|
||||
collection: SanitizedCollectionConfig | null
|
||||
context: RequestContext
|
||||
/**
|
||||
* Only available in `afterRead` hooks
|
||||
*/
|
||||
currentDepth?: number /**
|
||||
* Only available in `afterRead` hooks
|
||||
*/
|
||||
/** The data passed to update the document within create and update operations, and the full document itself in the afterRead hook. */
|
||||
data?: Partial<TData>
|
||||
/**
|
||||
* Only available in the `afterRead` hook.
|
||||
*/
|
||||
depth?: number
|
||||
draft?: boolean
|
||||
/** The field which the hook is running against. */
|
||||
field: FieldAffectingData
|
||||
|
||||
@@ -204,7 +204,9 @@ export const promise = async ({
|
||||
const hookedValue = await currentHook({
|
||||
collection,
|
||||
context,
|
||||
currentDepth,
|
||||
data: doc,
|
||||
depth,
|
||||
draft,
|
||||
field,
|
||||
findMany,
|
||||
@@ -231,7 +233,9 @@ export const promise = async ({
|
||||
const hookedValue = await currentHook({
|
||||
collection,
|
||||
context,
|
||||
currentDepth,
|
||||
data: doc,
|
||||
depth,
|
||||
draft,
|
||||
field,
|
||||
findMany,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { FormState } from 'payload'
|
||||
import type { FormState } from '../admin/types.js'
|
||||
|
||||
import { unflatten } from './unflatten.js'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user