What is the need for then(response => response) on each method? Did you intend to extract data from the response so the consumer doesn't have to grab data each time? Such as return axiosClient.get(/${URL}).then(response => response.data);? Otherwise it could be removed to shorten those wrapper/helper methods.
What happens when you remove .then(response => response) from getRequest(URL). Does it change how const user = await getRequest('users'); works at all?
Some comments have been hidden by the post's author - find out more
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
What is the need for
then(response => response)
on each method? Did you intend to extractdata
from the response so the consumer doesn't have to grabdata
each time? Such asreturn axiosClient.get(
/${URL}).then(response => response.data);
? Otherwise it could be removed to shorten those wrapper/helper methods.To access the response like below
What happens when you remove
.then(response => response)
fromgetRequest(URL)
. Does it change howconst user = await getRequest('users');
works at all?