diff options
author | ilyayudovin <ilyayudovin123@gmail.com> | 2020-08-18 23:59:28 +0300 |
---|---|---|
committer | ilyayudovin <ilyayudovin123@gmail.com> | 2020-08-18 23:59:28 +0300 |
commit | e2686e861b3d999342b1de7838905b22e7e3d046 (patch) | |
tree | 3f0dc80a43e1475ccad0ef9c961804ef70b0782b /src/hooks/useS3Preupload.tsx | |
parent | 6c9ee57d83d30d598062cfa95a73555808e04e7f (diff) | |
download | which-ui-e2686e861b3d999342b1de7838905b22e7e3d046.tar.gz |
add console logs
Diffstat (limited to 'src/hooks/useS3Preupload.tsx')
-rw-r--r-- | src/hooks/useS3Preupload.tsx | 15 |
1 files changed, 12 insertions, 3 deletions
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]); |