adding a cleaner api and such
This commit is contained in:
@@ -1,19 +1,14 @@
|
|||||||
import { useMutation, useQuery } from "react-query";
|
import { useMutation, useQuery } from "react-query";
|
||||||
|
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
|
import { nirvanaApi } from "./nirvanaApi";
|
||||||
|
|
||||||
export enum Querytypes {
|
export enum Querytypes {
|
||||||
GET_USER_DETAILS = "GET_USER_DETAILS",
|
GET_USER_DETAILS = "GET_USER_DETAILS",
|
||||||
}
|
}
|
||||||
|
|
||||||
export const localHost = process.env.REACT_APP_API_DOMAIN;
|
|
||||||
|
|
||||||
export function useGetUserDetails() {
|
export function useGetUserDetails() {
|
||||||
return useQuery(Querytypes.GET_USER_DETAILS, () =>
|
return useQuery(Querytypes.GET_USER_DETAILS, nirvanaApi.getUserDetails, {
|
||||||
axios({
|
retry: true,
|
||||||
method: "GET",
|
});
|
||||||
url: localHost + `/users`,
|
|
||||||
headers: { Authorization: "fake_id_token" },
|
|
||||||
})
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user