Skip to content

Commit

Permalink
Merge pull request #90 from complexdatacollective/fix/file-download-e…
Browse files Browse the repository at this point in the history
…rrors

Fix: Interview Export Errors
  • Loading branch information
jthrilly committed Mar 4, 2024
2 parents 725f57e + 223f181 commit 4bfe106
Showing 1 changed file with 9 additions and 1 deletion.
Expand Up @@ -74,8 +74,16 @@ export const ExportInterviewsDialog = ({
throw new Error(e.message);
}

const response = await fetch(result.data.url);
const blob = await response.blob();

// create a download link
const url = URL.createObjectURL(blob);

// Download the zip file
download(result.data.url, result.data.name);
download(url, result.data.name);
// clean up the URL object
URL.revokeObjectURL(url);
} catch (error) {
toast({
icon: <XCircle />,
Expand Down

0 comments on commit 4bfe106

Please sign in to comment.