Source

apis/ShareHistory.js

import { useQuery } from "@tanstack/react-query";
import Axios from "../utils/ApiConfiguration";
/**
 * Custom hook to fetch a list of share history.
 *
 * This hook sends a request to retrieve a list of share history from the server.
 *
 * @returns {Object} The query result object.
 *
 * @example
 * // Usage of useGetShareHistoryList hook
 * const { data, isLoading, error } = useGetShareHistoryList();
 */
export const useGetShareHistoryList = () =>
  useQuery({
    queryKey: ["share-history-list"],
    queryFn: () => Axios.get("sharehistory/"),
    refetchOnWindowFocus: true,
  });