create rep pdf tweaks prior to multi types matrix
This commit is contained in:
+47
-1
@@ -428,6 +428,52 @@ export const uploadRepFiles = async (
|
||||
);
|
||||
};
|
||||
|
||||
export const uploadPDFRepFiles = async (
|
||||
formContent,
|
||||
containerName,
|
||||
foldername,
|
||||
repType
|
||||
) => {
|
||||
const containerToken = await createContainerSas(containerName);
|
||||
const sasUrl = `${STORAGE_PATH}/${containerName}?${containerToken}`;
|
||||
const containerClient = new ContainerClient(sasUrl);
|
||||
|
||||
const files = formContent;
|
||||
|
||||
console.log(formContent, containerName, foldername);
|
||||
console.log(
|
||||
"rep pdf files...",
|
||||
files,
|
||||
Object.keys(files).length,
|
||||
foldername
|
||||
);
|
||||
|
||||
// console.log(`files[${prop}] = ${files[prop][0].size}`);
|
||||
console.log(foldername + "/files/" + formContent.split("tmp/")[1]);
|
||||
|
||||
const blobName = foldername + "/" + formContent.split("tmp/")[1];
|
||||
console.log(blobName);
|
||||
|
||||
const blockBlobClient = containerClient.getBlockBlobClient(blobName);
|
||||
const uploadBlobResponse = await blockBlobClient.uploadFile(formContent);
|
||||
|
||||
const tags = {
|
||||
containerid: containerName,
|
||||
caseID: foldername.split("/")[0],
|
||||
documentType: repType,
|
||||
blobType: "RepresentationPDF",
|
||||
};
|
||||
|
||||
console.log("the tags:", tags);
|
||||
const withTags = await blockBlobClient.setTags(tags);
|
||||
const withMeta = await blockBlobClient.setMetadata(tags);
|
||||
|
||||
console.log(
|
||||
`Uploaded block blob ${files} successfully`,
|
||||
uploadBlobResponse.requestId
|
||||
);
|
||||
};
|
||||
|
||||
export const uploadPDFCaseFiles = async (
|
||||
formContent,
|
||||
containerName,
|
||||
@@ -821,7 +867,7 @@ export const getRepsBlobs = async (containerName) => {
|
||||
listOptions
|
||||
)) {
|
||||
const blobClient = await containerClient.getBlobClient(blob.name);
|
||||
console.log(blob);
|
||||
console.log("getreps blob blob", blob);
|
||||
blob.name.split("/")[2].indexOf("_rep.json") > 0 &&
|
||||
blob.name.split("/")[2].indexOf("undefined") < 0 &&
|
||||
blobObj.push({
|
||||
|
||||
Reference in New Issue
Block a user