Created
March 29, 2023 08:42
-
-
Save naveen1337/2c97639da6bee90bf732d61fe38a13e6 to your computer and use it in GitHub Desktop.
download_blob.ts
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
| const distibutionReq = useMutation(exportDataRemote, { | |
| onSuccess: (data) => { | |
| var file = window.URL.createObjectURL(data); | |
| var a = document.createElement('a'); | |
| a.href = file; | |
| a.download = "distribution.csv"; | |
| document.body.appendChild(a); | |
| a.click(); | |
| a.remove(); | |
| console.log(file); | |
| }, | |
| onError: (err) => { | |
| toast.error('failed to download !') | |
| console.log(err); | |
| } | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment