Skip to content

Instantly share code, notes, and snippets.

@naveen1337
Created March 29, 2023 08:42
Show Gist options
  • Select an option

  • Save naveen1337/2c97639da6bee90bf732d61fe38a13e6 to your computer and use it in GitHub Desktop.

Select an option

Save naveen1337/2c97639da6bee90bf732d61fe38a13e6 to your computer and use it in GitHub Desktop.
download_blob.ts
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