chore(examples): correct where path comes from in multi-tenant (#8698)
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
'use client'
|
||||
import { RelationshipField, useField } from '@payloadcms/ui'
|
||||
import { RelationshipField, useField, useFieldProps } from '@payloadcms/ui'
|
||||
import React from 'react'
|
||||
|
||||
type Props = {
|
||||
initialValue?: string
|
||||
path: string
|
||||
readOnly: boolean
|
||||
}
|
||||
export function TenantFieldComponentClient({ initialValue, path, readOnly }: Props) {
|
||||
export function TenantFieldComponentClient({ initialValue, readOnly }: Props) {
|
||||
const { path } = useFieldProps()
|
||||
const { formInitializing, setValue, value } = useField({ path })
|
||||
const hasSetInitialValue = React.useRef(false)
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ import React from 'react'
|
||||
import { TenantFieldComponentClient } from './Field.client'
|
||||
|
||||
export const TenantFieldComponent: React.FC<{
|
||||
path: string
|
||||
payload: Payload
|
||||
readOnly: boolean
|
||||
}> = async (args) => {
|
||||
@@ -22,7 +21,6 @@ export const TenantFieldComponent: React.FC<{
|
||||
return (
|
||||
<TenantFieldComponentClient
|
||||
initialValue={cookies.get('payload-tenant')?.value || undefined}
|
||||
path={args.path}
|
||||
readOnly={args.readOnly}
|
||||
/>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user