chore(examples): correct where path comes from in multi-tenant (#8698)

This commit is contained in:
Jarrod Flesch
2024-10-16 08:28:28 -04:00
committed by GitHub
parent a19e8d382d
commit a9c6a91c1c
2 changed files with 3 additions and 5 deletions

View File

@@ -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)

View File

@@ -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}
/>
)