Updated client packages
This commit is contained in:
@@ -66,7 +66,9 @@ export function useSetField(entity_type: EntityType) {
|
||||
},
|
||||
onMutate: async ({ key, params }) => {
|
||||
// Cancel any outgoing refetches (so they don't overwrite our optimistic update)
|
||||
await queryClient.cancelQueries(["fields", entity_type]);
|
||||
await queryClient.cancelQueries({
|
||||
queryKey: ["fields", entity_type]
|
||||
});
|
||||
|
||||
// Snapshot the previous value
|
||||
const previousFields = queryClient.getQueryData<Field[]>(["fields", entity_type]);
|
||||
@@ -101,7 +103,9 @@ export function useSetField(entity_type: EntityType) {
|
||||
},
|
||||
onSettled: () => {
|
||||
// Invalidate and refetch
|
||||
queryClient.invalidateQueries(["fields", entity_type]);
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: ["fields", entity_type]
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
@@ -124,7 +128,9 @@ export function useDeleteField(entity_type: EntityType) {
|
||||
},
|
||||
onSuccess: () => {
|
||||
// Invalidate and refetch
|
||||
queryClient.invalidateQueries(["fields", entity_type]);
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: ["fields", entity_type]
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -52,7 +52,9 @@ export function useSetSetting<T>(key: string) {
|
||||
return response.json();
|
||||
},
|
||||
onMutate: async (value) => {
|
||||
await queryClient.cancelQueries(["settings", key]);
|
||||
await queryClient.cancelQueries({
|
||||
queryKey: ["settings", key]
|
||||
});
|
||||
const previousValue = queryClient.getQueryData<SettingResponseValue>(["settings", key]);
|
||||
queryClient.setQueryData<SettingResponseValue>(["settings", key], (old) =>
|
||||
old ? { ...old, value: JSON.stringify(value) } : undefined
|
||||
@@ -64,7 +66,9 @@ export function useSetSetting<T>(key: string) {
|
||||
},
|
||||
onSuccess: (_data, _value) => {
|
||||
// Invalidate and refetch
|
||||
queryClient.invalidateQueries(["settings", key]);
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: ["settings", key]
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ import { CrudFilter, CrudSort } from "@refinedev/core";
|
||||
import { useEffect, useState } from "react";
|
||||
import { isLocalStorageAvailable } from "./support";
|
||||
interface Pagination {
|
||||
current: number;
|
||||
currentPage: number;
|
||||
pageSize: number;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user