Classgen: refactor functions
This commit is contained in:
@@ -9,10 +9,11 @@ export const BlockDevicesView: Component = () => {
|
||||
refetch: loadDevices,
|
||||
isFetching,
|
||||
} = createQuery(() => ({
|
||||
queryKey: ["TanStack Query"],
|
||||
queryKey: ["block_devices"],
|
||||
queryFn: async () => {
|
||||
const result = await callApi("show_block_devices", {});
|
||||
if (result.status === "error") throw new Error("Failed to fetch data");
|
||||
|
||||
return result.data;
|
||||
},
|
||||
staleTime: 1000 * 60 * 5,
|
||||
|
||||
@@ -34,7 +34,7 @@ export const Flash = () => {
|
||||
refetch: loadDevices,
|
||||
isFetching,
|
||||
} = createQuery(() => ({
|
||||
queryKey: ["TanStack Query"],
|
||||
queryKey: ["block_devices"],
|
||||
queryFn: async () => {
|
||||
const result = await callApi("show_block_devices", {});
|
||||
if (result.status === "error") throw new Error("Failed to fetch data");
|
||||
|
||||
Reference in New Issue
Block a user