From f00c95d43e9a5339619e5261ab04fd08add13c77 Mon Sep 17 00:00:00 2001 From: Solomon kabaliisa <36126424+kabaliisa@users.noreply.github.com> Date: Thu, 4 Mar 2021 14:15:24 +0300 Subject: [PATCH] Fix return statement to immediately return data (#563) --- simplq/src/api/auth.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/simplq/src/api/auth.js b/simplq/src/api/auth.js index 19f329e1..fcae5875 100644 --- a/simplq/src/api/auth.js +++ b/simplq/src/api/auth.js @@ -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: { @@ -52,8 +52,8 @@ const useMakeAuthedRequest = () => { Authorization: await getAuthHeaderValue(auth), }, }); - const response = await authedRequest; - return response.data; + + return data; }; return makeAuthedRequest;