fix(ui): create-first-user crashes when users collection has join field (#10871)
Fixes https://github.com/payloadcms/payload/issues/10870 Now we hide join fields from the `/create-first-user` view since they're not meaningful there.
This commit is contained in:
@@ -161,18 +161,22 @@ const JoinFieldComponent: JoinFieldClientComponent = (props) => {
|
||||
}
|
||||
|
||||
return where
|
||||
}, [docID, field.targetField.relationTo, field.where, on, docConfig.slug])
|
||||
}, [docID, field.targetField.relationTo, field.where, on, docConfig?.slug])
|
||||
|
||||
const initialDrawerData = useMemo(() => {
|
||||
const relatedCollection = getEntityConfig({ collectionSlug: field.collection })
|
||||
|
||||
return getInitialDrawerData({
|
||||
collectionSlug: docConfig.slug,
|
||||
collectionSlug: docConfig?.slug,
|
||||
docID,
|
||||
fields: relatedCollection.fields,
|
||||
segments: field.on.split('.'),
|
||||
})
|
||||
}, [getEntityConfig, field.collection, field.on, docConfig.slug, docID])
|
||||
}, [getEntityConfig, field.collection, field.on, docConfig?.slug, docID])
|
||||
|
||||
if (!docConfig) {
|
||||
return null
|
||||
}
|
||||
|
||||
return (
|
||||
<div
|
||||
|
||||
Reference in New Issue
Block a user