IO-1169 Download only images.
This commit is contained in:
@@ -14,11 +14,11 @@ export default function JobsDocumentsDownloadButton({
|
||||
const [download, setDownload] = useState(null);
|
||||
const imagesToDownload = [
|
||||
...galleryImages.images.filter((image) => image.isSelected),
|
||||
...galleryImages.other.filter((image) => image.isSelected),
|
||||
// ...galleryImages.other.filter((image) => image.isSelected),
|
||||
];
|
||||
|
||||
const handleDownload = () => {
|
||||
logImEXEvent("jobs_documents_download");
|
||||
|
||||
axios
|
||||
.post("/media/download", {
|
||||
ids: imagesToDownload.map((_) => _.key),
|
||||
@@ -27,12 +27,8 @@ export default function JobsDocumentsDownloadButton({
|
||||
// window.open(r.data);
|
||||
downloadAs(
|
||||
r.data,
|
||||
`${identifier || "images"}.zip`,
|
||||
`${identifier || "documents"}.zip`,
|
||||
(progressEvent) => {
|
||||
const percentage = Math.round(
|
||||
(progressEvent.loaded * 100) / progressEvent.total
|
||||
);
|
||||
console.log(progressEvent, percentage);
|
||||
setDownload((currentDownloadState) => {
|
||||
return {
|
||||
downloaded: progressEvent.loaded || 0,
|
||||
|
||||
Reference in New Issue
Block a user