adding a cleaner api and such

This commit is contained in:
talksik
2022-03-16 11:27:36 -04:00
parent fb35e2835e
commit 72f6236db5
2 changed files with 4 additions and 9 deletions
+4 -9
View File
@@ -1,19 +1,14 @@
import { useMutation, useQuery } from "react-query";
import axios from "axios";
import { nirvanaApi } from "./nirvanaApi";
export enum Querytypes {
GET_USER_DETAILS = "GET_USER_DETAILS",
}
export const localHost = process.env.REACT_APP_API_DOMAIN;
export function useGetUserDetails() {
return useQuery(Querytypes.GET_USER_DETAILS, () =>
axios({
method: "GET",
url: localHost + `/users`,
headers: { Authorization: "fake_id_token" },
})
);
return useQuery(Querytypes.GET_USER_DETAILS, nirvanaApi.getUserDetails, {
retry: true,
});
}