import { useQuery } from "@tanstack/react-query";
import { client } from "@/lib/hono";
export const useGetRentProperties = () => {
const query = useQuery({
queryKey: ["properties"],
queryFn: async () => {
const response = await client.api.properties.$get();
if (!response.ok) {
throw new Error("Failed to fetch transactions!");
}
const { data } = await response.json();
return data;
},
});
return query;
};
import { useQuery } from "@tanstack/react-query";
import { client } from "@/lib/hono";
export const useGetRentProperties = () => {
const query = useQuery({
queryKey: ["properties"],
queryFn: async () => {
const response = await client.api.properties.$get();
if (!response.ok) {
throw new Error("Failed to fetch transactions!");
}
const { data } = await response.json();
return data;
},
});
return query;
};