Commit 10f3ed7c by G

commented Authorization for the moment. remove hard forced POST request in client option

parent 83b3bcdd
...@@ -7,7 +7,7 @@ const client = axios.create({baseURL : baseUrl}); ...@@ -7,7 +7,7 @@ const client = axios.create({baseURL : baseUrl});
const axiosRequest = async<T> ({...options}) : Promise<T> => { const axiosRequest = async<T> ({...options}) : Promise<T> => {
// console.log("base Url", baseUrl); // console.log("base Url", baseUrl);
client.defaults.headers.common.Authorization = `Bearer ${""}`; // client.defaults.headers.common.Authorization = `Bearer ${""}`;
// client.defaults.headers.common['Content-Type'] = 'application/json'; // client.defaults.headers.common['Content-Type'] = 'application/json';
// console.log("client default", client.defaults); // console.log("client default", client.defaults);
// console.log("client datas", client.defaults.data); // console.log("client datas", client.defaults.data);
...@@ -21,7 +21,7 @@ const axiosRequest = async<T> ({...options}) : Promise<T> => { ...@@ -21,7 +21,7 @@ const axiosRequest = async<T> ({...options}) : Promise<T> => {
}; };
try { try {
const response : AxiosResponse<T> = await client({ ...options, method: "POST" }); const response : AxiosResponse<T> = await client({ ...options });
return onSuccess(response.data); return onSuccess(response.data);
} catch (error : any) { } catch (error : any) {
console.error("Axios Request Error :: ", error.response.data); console.error("Axios Request Error :: ", error.response.data);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment