create pdf reps for lpa

This commit is contained in:
2023-09-26 09:12:57 +01:00
parent 34c3e06ee3
commit 41847b3433
55 changed files with 8798 additions and 168 deletions
+53 -13
View File
@@ -1,6 +1,37 @@
/**
* @swagger
* /api/file/getrepsblob:
* get:
* tags: [Azure Storage]
* summary: Phase 2
* description: get reps blobs
* parameters:
* - name: container
* in: query
* required: true
* example: cl761h97h0008h11ycmu2qyfo
* schema:
* type: string
* - name: casefolderID
* in: query
* required: true
* example: TMP-AYJHX-SNW1H5
* schema:
* type: string
* - name: hash
* in: query
* required: true
* example: 372c59f86d62b57cc2a7981eeee7737c944d407c6a7f2ea9d85797bbfe9852c5
* schema:
* type: string
* responses:
* 200:
* description: Success
*/
import {
downloadAllRepsFiles,
getRepslobs,
getRepsBlobs,
} from "../../../actions/azurestorage";
import _ from "lodash";
import nextConnect from "next-connect";
@@ -17,23 +48,32 @@ ApiProxy.get(async (req, res) => {
var checkHash = req.query.hash;
var checkquerypath = "/api/file/getrepsblob?container=" + containerName;
// console.log("-----", casefolderID);
// console.log("-----", req.query);
// console.log("-----", checkquerypath);
// console.log("-----", hashAPIPath(checkquerypath));
// console.log("-----", checkHash);
// console.log(hashAPIPath(checkquerypath) == "&hash=" + checkHash);
if (hashAPIPath(checkquerypath) == "&hash=" + checkHash) {
const blobObj = await getRepslobs(containerName, casefolderID)
.then((data) => {
return downloadAllRepsFiles(containerName, data);
const blobObj = await getRepsBlobs(containerName, casefolderID)
.then(async (data) => {
console.log("----------xxxxxx------", data);
let result = await downloadAllRepsFiles(containerName, data);
return res.status(200).json(result);
})
.then((data) => {
return res.status(200).json(data);
.catch((error) => {
console.log(
"///////////////////////\ngetRepsFromBlob api in api route response: " +
error +
"\n///////////////////////\n"
);
console.log("API call error", error);
});
} else {
return res.status(400).json();
return res.status(400).json({ msg: "error" });
}
});
export const config = {
api: {
bodyParser: false,
},
};
export default ApiProxy;