Getting wrong error message
const handleDownloadPicture = async (ids: number) => {
try {
const response = await axios
.post(`/api/folders/${folderDetails.id}/download`, {
resources: ids,
},{responseType:'blob'},
)
.then(({ data: blob }) => {
const link = document.createElement('a');
const url = URL.createObjectURL(blob);
link.href = url;
link.download = 'myfile.zip';
link.click();
});
} catch (error) {
console.error(error);
}
};
I'm getting the wrong error message on console.log(error)
have tried multiple solutions of converting blob response to json but no result