Skip to content

Commit

Permalink
Merge pull request #10389 from dricholm/fix/reference-field-query-opt…
Browse files Browse the repository at this point in the history
…ions

Align queryOptions type in reference components and controller
  • Loading branch information
fzaninotto authored Nov 27, 2024
2 parents bc4a1e0 + 2b0498f commit 77f7ed8
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,9 @@ export interface UseReferenceFieldControllerOptions<
ReferenceRecordType extends RaRecord = RaRecord,
> {
source: string;
queryOptions?: Partial<
UseQueryOptions<ReferenceRecordType[], Error> & {
meta?: any;
}
queryOptions?: Omit<
UseQueryOptions<ReferenceRecordType[], Error>,
'queryFn' | 'queryKey'
>;
reference: string;
link?: LinkToType<ReferenceRecordType>;
Expand Down
5 changes: 4 additions & 1 deletion packages/ra-ui-materialui/src/field/ReferenceArrayField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,10 @@ export interface ReferenceArrayFieldProps<
reference: string;
sort?: SortPayload;
sx?: SxProps;
queryOptions?: UseQueryOptions<ReferenceRecordType[], Error>;
queryOptions?: Omit<
UseQueryOptions<ReferenceRecordType[], Error>,
'queryFn' | 'queryKey'
>;
}

export interface ReferenceArrayFieldViewProps
Expand Down
7 changes: 3 additions & 4 deletions packages/ra-ui-materialui/src/field/ReferenceField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,9 @@ export interface ReferenceFieldProps<
ReferenceRecordType extends RaRecord = RaRecord,
> extends FieldProps<RecordType> {
children?: ReactNode;
queryOptions?: Partial<
UseQueryOptions<ReferenceRecordType[], Error> & {
meta?: any;
}
queryOptions?: Omit<
UseQueryOptions<ReferenceRecordType[], Error>,
'queryFn' | 'queryKey'
>;
reference: string;
translateChoice?: Function | boolean;
Expand Down

0 comments on commit 77f7ed8

Please sign in to comment.