import { useQuery } from "@tanstack/react-query";
import { wwwAPI } from "@/utilities/wwwAPI";
import { GetCommentAPI } from "@/type/wwwAPI";

export default function useGetComment(essayID: string) {
  return useQuery({
    queryKey: ["comment", essayID],
    queryFn: async () => {
      const { data } = await wwwAPI.get<GetCommentAPI>(`/comment/${essayID}`);
      return data;
    },
    initialData: [],
  });
}
