@@ -1,3 +1,4 @@
|
||||
import { LinkIncludingShortenedCollectionAndTags } from "@/types/global";
|
||||
import { useQuery } from "@tanstack/react-query";
|
||||
import { useSession } from "next-auth/react";
|
||||
|
||||
@@ -6,11 +7,11 @@ const useDashboardData = () => {
|
||||
|
||||
return useQuery({
|
||||
queryKey: ["dashboardData"],
|
||||
queryFn: async () => {
|
||||
const response = await fetch("/api/v2/dashboard");
|
||||
queryFn: async (): Promise<LinkIncludingShortenedCollectionAndTags[]> => {
|
||||
const response = await fetch("/api/v1/dashboard");
|
||||
const data = await response.json();
|
||||
|
||||
return data.data;
|
||||
return data.response;
|
||||
},
|
||||
enabled: status === "authenticated",
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user