mirror of
https://github.com/OHTU-German-learning-website/OHTU-German-learning-website.git
synced 2026-10-12 19:13:51 +03:00
accidentally made the hook a function call rather than having it return a fumnction... (#41)
This commit is contained in:
@@ -7,16 +7,16 @@ const defaultConfig = {
|
||||
},
|
||||
};
|
||||
|
||||
/**
|
||||
* @description This hook is used to make a request to the server.
|
||||
* Mainly used for non-GET requests.
|
||||
* @param {string} url - The URL to make the request to.
|
||||
* @param {Object} body - The body of the request.
|
||||
* @param {Object} config - The config of the request.
|
||||
* @returns {Object} - The response from the server.
|
||||
*/
|
||||
export const useRequest = (url, body, config) => {
|
||||
return axiosInstance.request({
|
||||
export const useRequest = () => {
|
||||
/**
|
||||
* @description This hook is used to make a request to the server.
|
||||
* Mainly used for non-GET requests.
|
||||
* @param {string} url - The URL to make the request to.
|
||||
* @param {Object} body - The body of the request.
|
||||
* @param {Object} config - The config of the request.
|
||||
* @returns {Object} - The response from the server.
|
||||
*/
|
||||
return (url, body, config) => axiosInstance.request({
|
||||
url,
|
||||
data: body,
|
||||
...defaultConfig,
|
||||
|
||||
Reference in New Issue
Block a user