From e2686e861b3d999342b1de7838905b22e7e3d046 Mon Sep 17 00:00:00 2001
From: ilyayudovin <ilyayudovin123@gmail.com>
Date: Tue, 18 Aug 2020 23:59:28 +0300
Subject: add console logs

---
 src/hooks/useS3Preupload.tsx | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

(limited to 'src/hooks/useS3Preupload.tsx')

diff --git a/src/hooks/useS3Preupload.tsx b/src/hooks/useS3Preupload.tsx
index 3545cd5..a87eda0 100644
--- a/src/hooks/useS3Preupload.tsx
+++ b/src/hooks/useS3Preupload.tsx
@@ -46,15 +46,24 @@ export default (): Hook => {
 
       setProgress(0.01);
       return get('/files')
-        .then(response => response.data)
-        .then(uploadUrl => axios.put(uploadUrl, file, config))
-        .then(response => {
+        .then(function(response){
+          console.log({'resData': response.data});
+          debugger;
+          return response.data;
+        })
+        .then(function(uploadUrl){
+          console.log({'uploadUrl': uploadUrl});
+          return axios.put(uploadUrl, file, config);
+        })
+        .then(function(response){
           setProgress(100);
           const uri = response.config.url;
+          console.log({'uri': uri?.slice(0, uri.indexOf('?'))});
           return uri ? uri.slice(0, uri.indexOf('?')) : '';
         });
     }
     setProgress(100);
+    console.log({'url': url});
     return url || '';
   }, [file, handleUploadProgress, url]);
 
-- 
cgit v1.2.3

