Created
April 5, 2024 07:45
-
-
Save zbeyens/10bd63ae6d327de47a77e0e05ec6d237 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
export const fetchCompressImage = async (file: Blob) => { | |
const formData = new FormData(); | |
formData.append('Content-Type', file.type); | |
formData.append('file', file); | |
const res = await fetch(apiRoutes.compressImage, { | |
body: formData, | |
method: 'POST', | |
}); | |
return await res.blob(); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment