replace axios with fetch
This commit is contained in:
parent
1470abbbde
commit
926a2c2407
|
@ -1,11 +1,13 @@
|
|||
import { useQuery } from "@tanstack/react-query";
|
||||
import axios from "axios";
|
||||
|
||||
export const useClientSchedule = (clientId: string, key: string) => {
|
||||
const { isLoading, error, data } = useQuery({
|
||||
queryKey: ["schedule"],
|
||||
queryFn: () => {
|
||||
return axios.get(`/v2/schedules/${clientId}?apiKey=${key}`).then((res) => res.data);
|
||||
return fetch(`/v2/schedules/${clientId}?apiKey=${key}`, {
|
||||
method: "get",
|
||||
headers: { "Content-type": "application/json" },
|
||||
}).then((res) => res.json());
|
||||
},
|
||||
});
|
||||
|
||||
|
|
|
@ -1,11 +1,13 @@
|
|||
import { useQuery } from "@tanstack/react-query";
|
||||
import axios from "axios";
|
||||
|
||||
export const useProfileInfo = (key: string) => {
|
||||
const { data } = useQuery({
|
||||
queryKey: ["user"],
|
||||
queryFn: () => {
|
||||
return axios.get(`/v2/me?apiKey=${key}`).then((res) => res.data);
|
||||
return fetch(`/v2/me?apiKey=${key}`, {
|
||||
method: "get",
|
||||
headers: { "Content-type": "application/json" },
|
||||
}).then((res) => res.json());
|
||||
},
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user