adding axios and call to backend working with the auth check middleware

This commit is contained in:
talksik
2022-03-16 09:24:05 -04:00
parent 565b01cd8e
commit 0ad5429b53
9 changed files with 85 additions and 28 deletions
+19
View File
@@ -0,0 +1,19 @@
import { useMutation, useQuery } from "react-query";
import axios from "axios";
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" },
})
);
}