BOD-5 BOD-36 #comment Added Audit Trail List to jobs and created Audit List view component + queries

This commit is contained in:
Patrick Fic
2020-03-10 11:02:28 -07:00
parent d1cfd9bacf
commit 05d7aa7000
10 changed files with 345 additions and 21 deletions

View File

@@ -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)
// );
};