Skip to content

Commit 66416c1

Browse files
committed
Fix following tanstack/query-core upgrade
1 parent 3fda18b commit 66416c1

File tree

7 files changed

+10
-7
lines changed

7 files changed

+10
-7
lines changed

packages/ra-core/src/auth/useAuthState.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ const useAuthState = <ErrorType = Error>(
150150

151151
return authProvider != null
152152
? result
153-
: (noAuthProviderQueryResult as UseAuthStateResult<ErrorType>);
153+
: (noAuthProviderQueryResult as unknown as UseAuthStateResult<ErrorType>);
154154
};
155155

156156
type UseAuthStateOptions<ErrorType = Error> = Omit<

packages/ra-core/src/auth/useCanAccess.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ export const useCanAccess = <
9393

9494
return authProviderHasCanAccess
9595
? result
96-
: (emptyQueryObserverResult as UseCanAccessResult<ErrorType>);
96+
: (emptyQueryObserverResult as unknown as UseCanAccessResult<ErrorType>);
9797
};
9898

9999
const emptyQueryObserverResult = {

packages/ra-core/src/auth/usePermissions.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,10 @@ const usePermissions = <PermissionsType = any, ErrorType = Error>(
108108
);
109109

110110
return !authProvider || !authProvider.getPermissions
111-
? (fakeQueryResult as UsePermissionsResult<PermissionsType, ErrorType>)
111+
? (fakeQueryResult as unknown as UsePermissionsResult<
112+
PermissionsType,
113+
ErrorType
114+
>)
112115
: result;
113116
};
114117

packages/ra-core/src/controller/input/useReferenceInputController.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ export const useReferenceInputController = <RecordType extends RaRecord = any>(
118118
} = useReference<RecordType>({
119119
id: currentValue,
120120
reference,
121-
// @ts-ignore the types of the queryOptions for the getMAny and getList are not compatible
122121
options: {
122+
// @ts-ignore the types of the queryOptions for the getMany and getList are not compatible
123123
enabled: currentValue != null && currentValue !== '',
124124
meta,
125125
...otherQueryOptions,

packages/ra-core/src/dataProvider/addOfflineSupportToQueryClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export const addOfflineSupportToQueryClient = ({
9292
resources.forEach(resource => {
9393
DataProviderMutations.forEach(mutation => {
9494
queryClient.setMutationDefaults([resource, mutation], {
95-
mutationFn: async params => {
95+
mutationFn: async (params: any) => {
9696
const dataProviderFn = dataProvider[mutation] as Function;
9797
return dataProviderFn.apply(dataProviderFn, ...params);
9898
},

packages/ra-core/src/dataProvider/useGetList.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ export const useGetList = <
176176
}
177177
: result,
178178
[result]
179-
) as UseQueryResult<RecordType[], Error> & {
179+
) as unknown as UseQueryResult<RecordType[], Error> & {
180180
total?: number;
181181
pageInfo?: {
182182
hasNextPage?: boolean;

packages/ra-core/src/dataProvider/useGetManyReference.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ export const useGetManyReference = <
155155
}
156156
: result,
157157
[result]
158-
) as UseQueryResult<RecordType[], ErrorType> & {
158+
) as unknown as UseQueryResult<RecordType[], ErrorType> & {
159159
total?: number;
160160
pageInfo?: {
161161
hasNextPage?: boolean;

0 commit comments

Comments
 (0)