import { useQuery } from "@tanstack/react-query";

import { wwwAXIOS } from "src/Www";
import { GetLatestAvatarAPI } from "src/wwwAPI";

export default function useGetLatestAvatar() {
  return useQuery({
    queryKey: ["latestAvatar"],
    queryFn: async () => {
      const { data } = await wwwAXIOS.get<GetLatestAvatarAPI>("/avatar/latest");
      return data;
    },
    initialData: [],
  });
}
