BOD-5 BOD-36 #comment Added Audit Trail List to jobs and created Audit List view component + queries
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
var JSZip = require("jszip");
|
||||
//var JSZip = require("jszip");
|
||||
const axios = require("axios"); // to get the images
|
||||
require("dotenv").config();
|
||||
|
||||
@@ -6,19 +6,19 @@ module.exports.downloadImages = async function(req, res) {
|
||||
if (process.env.NODE_ENV !== "production") {
|
||||
console.log("[IMAGES] Incoming Images to Download", req.body);
|
||||
}
|
||||
const zip = new JSZip();
|
||||
//res.json({ success: true });
|
||||
req.body.images.forEach(i => {
|
||||
axios.get(i).then(r => zip.file(r));
|
||||
// const buffer = await response.buffer();
|
||||
// zip.file(file, buffer);
|
||||
});
|
||||
// // Set the name of the zip file in the download
|
||||
res.setHeader("Content-Type", "application/zip");
|
||||
// const zip = new JSZip();
|
||||
// //res.json({ success: true });
|
||||
// req.body.images.forEach(i => {
|
||||
// axios.get(i).then(r => zip.file(r));
|
||||
// // const buffer = await response.buffer();
|
||||
// // zip.file(file, buffer);
|
||||
// });
|
||||
// // // Set the name of the zip file in the download
|
||||
// res.setHeader("Content-Type", "application/zip");
|
||||
|
||||
zip.generateAsync({ type: "nodebuffer" }).then(
|
||||
function(content) {
|
||||
res.send(content);
|
||||
}.bind(res)
|
||||
);
|
||||
// zip.generateAsync({ type: "nodebuffer" }).then(
|
||||
// function(content) {
|
||||
// res.send(content);
|
||||
// }.bind(res)
|
||||
// );
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user