Skip to content

Commit

Permalink
chore(examples): correct where path comes from in multi-tenant (#8698)
Browse files Browse the repository at this point in the history
  • Loading branch information
JarrodMFlesch authored Oct 16, 2024
1 parent a19e8d3 commit a9c6a91
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -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)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand All @@ -22,7 +21,6 @@ export const TenantFieldComponent: React.FC<{
return (
<TenantFieldComponentClient
initialValue={cookies.get('payload-tenant')?.value || undefined}
path={args.path}
readOnly={args.readOnly}
/>
)
Expand Down

0 comments on commit a9c6a91

Please sign in to comment.