Skip to content

Commit

Permalink
Fix return statement to immediately return data (#563)
Browse files Browse the repository at this point in the history
  • Loading branch information
kabaliisa authored Mar 4, 2021
1 parent 505d121 commit f00c95d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions simplq/src/api/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const useMakeAuthedRequest = () => {
* @returns {Object} request response data as a Promise.
*/
const makeAuthedRequest = async (request) => {
const authedRequest = axios({
const { data } = await axios({
baseURL,
...request,
headers: {
Expand All @@ -52,8 +52,8 @@ const useMakeAuthedRequest = () => {
Authorization: await getAuthHeaderValue(auth),
},
});
const response = await authedRequest;
return response.data;

return data;
};

return makeAuthedRequest;
Expand Down

0 comments on commit f00c95d

Please sign in to comment.