rich text field and pdf create for appeal
This commit is contained in:
@@ -474,6 +474,52 @@ export const uploadPDFRepFiles = async (
|
||||
);
|
||||
};
|
||||
|
||||
export const uploadPDFAppealFiles = 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,
|
||||
|
||||
Reference in New Issue
Block a user