Skip to content
Snippets Groups Projects
Commit 2f9d35ac authored by Lukas's avatar Lukas
Browse files

Update usePostContentReplies hook

parent 3e4cfa37
No related branches found
No related tags found
1 merge request!510Lbudginas/#411 add post comments
import { useQuery } from "@tanstack/react-query";
import fetchingService from "@/services/FetchingService";
import Hive from "@/types/Hive";
const usePostContentReplies = (accountName: string, permlink: string) => {
const usePostContentReplies = (
accountName: string,
permlink: string,
...queryProps: any
) => {
const trimAccount = accountName.replace("@", "");
const { data, isLoading, isError } = useQuery({
queryKey: ["post content replies", trimAccount, permlink],
queryFn: () => fetchPostContentReplies(trimAccount, permlink),
refetchOnWindowFocus: false,
...queryProps,
});
const fetchPostContentReplies = async (
......@@ -23,7 +29,11 @@ const usePostContentReplies = (accountName: string, permlink: string) => {
return response;
};
return { data, isLoading, isError };
return { data, isLoading, isError } as {
data: Hive.Content[];
isLoading: boolean;
isError: boolean;
};
};
export default usePostContentReplies;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment