-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from choitaedong2/model_utility
update model utility
- Loading branch information
Showing
8 changed files
with
335 additions
and
449 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,28 @@ | ||
import axios from "axios"; | ||
|
||
export async function getPreSignedUrl(filename) { | ||
return axios.get(`/url/presigned?filename=${filename}`).then((response) => ({ | ||
uploadUrl: response.data.uploadUrl, | ||
downloadUrl: response.data.downloadUrl, | ||
})); | ||
} | ||
|
||
export async function uploadFileToS3(preSignedUrl, file, setUploadPercent) { | ||
return axios.put(preSignedUrl, file, { | ||
withCredentials: true, | ||
headers: { | ||
"Content-Type": "multipart/form-data", | ||
}, | ||
onUploadProgress: function (progressEvent) { | ||
const percentCompleted = Math.round( | ||
(progressEvent.loaded * 100) / progressEvent.total | ||
); | ||
|
||
setUploadPercent(percentCompleted); | ||
}, | ||
}); | ||
} | ||
|
||
export async function deleteFileFromS3(keys) { | ||
return axios.post(`/files`, keys); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
124 changes: 0 additions & 124 deletions
124
...c/components/presentational/model-learning/learning-result/ModelLearningResultContent.jsx
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.