This commit is contained in:
daniel31x13
2024-08-14 16:44:07 -04:00
parent 9cc3a7206e
commit 8031432995
19 changed files with 39 additions and 25 deletions
+4
View File
@@ -1,8 +1,11 @@
import { useQuery, useMutation, useQueryClient } from "@tanstack/react-query";
import toast from "react-hot-toast";
import { useTranslation } from "next-i18next";
import { useSession } from "next-auth/react";
const useUsers = () => {
const { status } = useSession();
return useQuery({
queryKey: ["users"],
queryFn: async () => {
@@ -17,6 +20,7 @@ const useUsers = () => {
const data = await response.json();
return data.response;
},
enabled: status === "authenticated",
});
};